FA-72830 / Check-digit algorithms / Member archive
DNI validation is case-sensitive · case 05
Numbers typed in lowercase are reported as mismatches or malformed.
Case contract
Spanish DNI/NIE control letter: input upper-cased, hyphens removed, then nine characters: eight digits (or X/Y/Z followed by seven digits, the prefix standing for 0/1/2) and a letter (else "malformed"). The letter is "TRWAGMYFPDXBNJZSQVHLCKE"[number mod 23]. Return [expected letter, match].
Why this case matters
Tax and KYC forms validate the control letter of Spanish national and foreigner identity numbers.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["12345678z"] | ["Z", false] | ["Z", 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 ↗