FAILURE MAP
← Case archive

FA-72343 / Check-digit algorithms / Member archive

Luhn validation doubles the check digit position · case 03

Valid card numbers are reported invalid while some single-digit typos pass.

Member previewVariant 3 · 3 implementations · 8 checks per implementation

Case contract

Input a card-style number that may contain spaces or hyphens as group separators. After removing them the text must be 2..19 ASCII digits, otherwise "malformed". Doubling applies to every second digit counting from the rightmost (check) digit, doubled values above 9 lose 9, and the number is "valid" when the sum is a multiple of 10, else "invalid".

Why this case matters

Payment-card, loyalty and account numbers are screened with the Luhn mod-10 check before any lookup.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
regression ["7985145013991721"]"invalid""valid"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 ↗