FA-72464 / Check-digit algorithms / Member archive
GTIN check digit uses the raw remainder · case 04
Nearly every valid code is rejected.
Case contract
Validate a GTIN-8, GTIN-12, GTIN-13 or GTIN-14 given as ASCII digits (any other length or character: "malformed"). Weights 3,1 alternate starting with 3 on the digit immediately left of the check digit, so the alignment is from the right for every length. Return [kind, check digit matches].
Why this case matters
Retail and logistics scanners accept several GTIN lengths through one validator.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["036000291452"] | ["GTIN-12", false] | ["GTIN-12", 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 ↗