FAILURE MAP
← Case archive

FA-72675 / Check-digit algorithms / Member archive

UPC-E admits number systems other than 0 and 1 · case 05

Eight-digit strings starting 2-9 are expanded as if they were UPC-E.

Member previewVariant 5 · 3 implementations · 8 checks per implementation

Case contract

Expand an 8-digit UPC-E (number system 0 or 1, six compressed digits m1..m6, check digit) to UPC-A. By m6: 0-2 -> m1 m2 m6 0000 m3 m4 m5; 3 -> m1 m2 m3 00000 m4 m5; 4 -> m1 m2 m3 m4 00000 m5; 5-9 -> m1..m5 0000 m6. The UPC-A check (weights 3,1 from the left over the 11 digits) must equal the given check digit; return the 12-digit UPC-A string, or None for malformed or mismatching input.

Why this case matters

Point-of-sale systems normalise zero-suppressed UPC-E labels into UPC-A keys for price lookup.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
regression ["28109420"]"281200000940"nullFailed

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 ↗