FAILURE MAP
← Case archive

FA-72659 / Check-digit algorithms / Member archive

UPC-E expansion places m5 before the zero run · case 04

Codes ending in compressed digit 4 expand to the wrong product number.

Member previewVariant 4 · 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 ["07813340"]null"078130000030"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 ↗