FA-72614 / Check-digit algorithms / Member archive
MRZ filler character is scored like a letter · case 04
Document numbers padded with "<" fail their check digit.
Case contract
Machine-readable passport (TD3) second line, 44 characters of 0-9, A-Z and the filler "<" (else "malformed"). Check digits use weights 7,3,1 restarting per field, "<" = 0, A-Z = 10-35: document number [0:9] check [9]; birth date [13:19] check [19]; expiry [21:27] check [27]; optional data [28:42] check [42] (a "<" check is allowed only when the optional field is entirely filler); composite check [43] over [0:10]+[13:20]+[21:43]. Return five booleans.
Why this case matters
Border-control kiosks verify MRZ check digits to catch OCR misreads before a database query.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"] | [true, true, true, true, false] | [true, true, true, true, true] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗