FAILURE MAP
← Case archive

FA-72457 / Check-digit algorithms / Member archive

GTIN validator rejects GTIN-8 and GTIN-14 · case 02

Short-format and case-level codes are reported malformed.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

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 fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression ["59804222888445"]"malformed"["GTIN-14", false]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 ↗