Data integrity
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
Keeping data correct
- Integrity means data stays accurate. Two techniques protect it: validation and verification.
- They sound similar but do different jobs — a classic exam distinction.
한국어
데이터 정확성 유지하기
- 무결성은 데이터가 정확한 상태를 유지함을 의미합니다. 이를 보호하는 두 가지 기법: 검증(validation) 과 확인(verification) 。
- They sound similar but do different jobs — a classic exam distinction.
English
Validation vs verification
- Validation checks data is reasonable as it is entered. Examples:
- Range check (age 0–120), length check (a phone number), format check (an email has an
@), presence check (not left blank).
- Range check (age 0–120), length check (a phone number), format check (an email has an
- Verification checks data was copied correctly. Examples:
- Double entry (type a password twice), or a visual check (read it back).
한국어
검증 vs 확인
- 검증(validation) 은 입력 시 데이터가 합리적인지 확인합니다. 예시:
- 범위 검사(연령 0–120), 길이 검사(전화번호), 양식 검사(이메일에
@포함), 존재 검사(빈칸 여부)。
- 범위 검사(연령 0–120), 길이 검사(전화번호), 양식 검사(이메일에
- 확인(verification) 는 데이터가 올바르게 복사되었는지 확인합니다. 예시:
- 이중 입력(비밀번호 두 번 입력), 또는 시각적 검사(다시 읽어보기)。
English
Checking data in transit
- When data travels, bits can flip. A checksum or check digit catches that.
- The sender calculates a small number from the data; the receiver recalculates it. If they differ, the data was corrupted.
한국어
전송 중 데이터 검증
- 데이터 전송 중 비트가翻转可能。Checksum或check digit可捕获该错误。
- Sender calculates a small number from the data; receiver recalculates it. If they differ, the data was corrupted.
number = "1389"
print(sum(int(d) for d in number) % 10) # a one-digit checksum
English
Your turn
- Compute a simple check digit by summing the digits modulo 10. Real systems (like barcodes and ISBNs) use cleverer versions of this idea.
Covers: A-Level 6.2 (validation/verification), IGCSE 2.2 (error detection).
한국어
직접 해보기
- Compute a simple check digit by summing the digits modulo 10. Real systems (like barcodes and ISBNs) use cleverer versions of this idea.
*内容:A-Level 6.2 (validation/verification),IGCSE 2.2 (error detection)。
English
Common mistakes
- A checksum or check digit spots accidental changes to data.
- Validation checks data is sensible; verification checks it was entered correctly.
한국어
흔한 실수
- A checksum or check digit spots accidental changes to data.
- Validation checks data is sensible; verification checks it was entered correctly.
Explore · 탐색하기
Hashes detect tampering
Re-hash the data and compare: any change flips the digest.
A simple checksum helps catch typing errors. Add up the digits of number and take the result modulo 10. Print that single check digit.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Now be the receiver. The sender transmitted the digits with check digit 8, but one digit got corrupted on the way. Recompute the checksum of received and print ERROR if it does not equal sent_check, else OK.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.