FA-72704 / Check-digit algorithms / Member archive
UK VAT reads only the last check digit · case 04
Most valid VAT numbers are rejected.
Case contract
UK VAT registration number check. Spaces are removed, the text is upper-cased and an optional GB prefix removed; the rest must be 9 ASCII digits (else "malformed"). Weights 8..2 apply to the first seven digits; the last two digits form a number c. Return "mod97" if (sum + c) is divisible by 97, "mod9755" if (sum + c + 55) is, else "invalid".
Why this case matters
Invoice processing screens supplier VAT numbers before reclaiming input tax.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["155142529"] | "invalid" | "mod9755" | 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 ↗