FA-72571 / Check-digit algorithms / Open access
MOD 11,10 starts the fold at one · case 01
Check digits disagree with the hybrid system for most payloads.
ROOT CAUSE
The running value starts at 1 instead of the modulus 10 (starting at 0 would be harmless because of the mod-10 step).
VERIFIED REPAIR
Initialise p = 10.
Unsuccessful approach: Starting at 11 (the other modulus) is congruent to 1 mod 10 and repeats the same error.
Case contract
ISO 7064 MOD 11,10 hybrid check digit generation for a nonempty ASCII digit payload (else None). Start with p = 10; for each digit p = ((p + d) mod 10, with 0 replaced by 10) * 2 mod 11; the check digit is (11 - p) mod 10.
Why this case matters
Tax and personal identification numbers (for example OIB-style identifiers) use the hybrid MOD 11,10 system.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if not s or not s.isascii() or not s.isdigit():
return None
p = 1
for ch in s:
p = ((p + int(ch)) % 10 or 10) * 2 % 11
return (11 - p) % 10
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["9"]', ['9'], 4], ['regression ["12"]', ['12'], 3], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["072"]', ['072'], 5], ['control ["36073"]', ['36073'], 5], ['control ["98772300"]', ['98772300'], 4], ['control ["3370345686"]', ['3370345686'], 4]], [['regression ["36073"]', ['36073'], 5], ['regression ["98772300"]', ['98772300'], 4], ['control ["12a"]', ['12a'], None], ['control [""]', [''], None], ['control ["2638206592"]', ['2638206592'], 8], ['control ["412595035658"]', ['412595035658'], 9], ['control ["0227566323850846"]', ['0227566323850846'], 4], ['control ["9477"]', ['9477'], 3]], [['regression ["6279939841"]', ['6279939841'], 2], ['regression ["2638206592"]', ['2638206592'], 8], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control ["6943515153"]', ['6943515153'], 0], ['control ["0"]', ['0'], 2], ['control ["1"]', ['1'], 9]], [['regression ["0227566323850846"]', ['0227566323850846'], 4], ['regression ["9477"]', ['9477'], 3], ['control ["12a"]', ['12a'], None], ['control [""]', [''], None], ['control ["3"]', ['3'], 5], ['control ["95"]', ['95'], 7], ['control ["55555"]', ['55555'], 1], ['control ["9"]', ['9'], 4]], [['regression ["9795751"]', ['9795751'], 6], ['regression ["6943515153"]', ['6943515153'], 0], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["9"]', ['9'], 4], ['control ["12"]', ['12'], 3], ['control ["072"]', ['072'], 5], ['control ["36073"]', ['36073'], 5]]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["9"] | 2 | 4 | Failed |
| regression ["12"] | 0 | 3 | Failed |
| control [""] | None | None | Passed |
| control ["12a"] | None | None | Passed |
| control ["072"] | 4 | 5 | Failed |
| control ["36073"] | 8 | 5 | Failed |
| control ["98772300"] | 5 | 4 | Failed |
| control ["3370345686"] | 5 | 4 | Failed |
SHA-256 / 961b2c861915bf1b5f8da1d2a435d902eb3656b93f77c9244bf2bf4d5b692bee
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if not s or not s.isascii() or not s.isdigit():
return None
p = 11
for ch in s:
p = ((p + int(ch)) % 10 or 10) * 2 % 11
return (11 - p) % 10
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["9"]', ['9'], 4], ['regression ["12"]', ['12'], 3], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["072"]', ['072'], 5], ['control ["36073"]', ['36073'], 5], ['control ["98772300"]', ['98772300'], 4], ['control ["3370345686"]', ['3370345686'], 4]], [['regression ["36073"]', ['36073'], 5], ['regression ["98772300"]', ['98772300'], 4], ['control ["12a"]', ['12a'], None], ['control [""]', [''], None], ['control ["2638206592"]', ['2638206592'], 8], ['control ["412595035658"]', ['412595035658'], 9], ['control ["0227566323850846"]', ['0227566323850846'], 4], ['control ["9477"]', ['9477'], 3]], [['regression ["6279939841"]', ['6279939841'], 2], ['regression ["2638206592"]', ['2638206592'], 8], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control ["6943515153"]', ['6943515153'], 0], ['control ["0"]', ['0'], 2], ['control ["1"]', ['1'], 9]], [['regression ["0227566323850846"]', ['0227566323850846'], 4], ['regression ["9477"]', ['9477'], 3], ['control ["12a"]', ['12a'], None], ['control [""]', [''], None], ['control ["3"]', ['3'], 5], ['control ["95"]', ['95'], 7], ['control ["55555"]', ['55555'], 1], ['control ["9"]', ['9'], 4]], [['regression ["9795751"]', ['9795751'], 6], ['regression ["6943515153"]', ['6943515153'], 0], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["9"]', ['9'], 4], ['control ["12"]', ['12'], 3], ['control ["072"]', ['072'], 5], ['control ["36073"]', ['36073'], 5]]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["9"] | 2 | 4 | Failed |
| regression ["12"] | 0 | 3 | Failed |
| control [""] | None | None | Passed |
| control ["12a"] | None | None | Passed |
| control ["072"] | 4 | 5 | Failed |
| control ["36073"] | 8 | 5 | Failed |
| control ["98772300"] | 5 | 4 | Failed |
| control ["3370345686"] | 5 | 4 | Failed |
SHA-256 / 47c6391115fa943e7d5a2a576dbcd670ecae0619a2ad915ddc488bb304b5757e
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if not s or not s.isascii() or not s.isdigit():
return None
p = 10
for ch in s:
p = ((p + int(ch)) % 10 or 10) * 2 % 11
return (11 - p) % 10
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["9"]', ['9'], 4], ['regression ["12"]', ['12'], 3], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["072"]', ['072'], 5], ['control ["36073"]', ['36073'], 5], ['control ["98772300"]', ['98772300'], 4], ['control ["3370345686"]', ['3370345686'], 4]], [['regression ["36073"]', ['36073'], 5], ['regression ["98772300"]', ['98772300'], 4], ['control ["12a"]', ['12a'], None], ['control [""]', [''], None], ['control ["2638206592"]', ['2638206592'], 8], ['control ["412595035658"]', ['412595035658'], 9], ['control ["0227566323850846"]', ['0227566323850846'], 4], ['control ["9477"]', ['9477'], 3]], [['regression ["6279939841"]', ['6279939841'], 2], ['regression ["2638206592"]', ['2638206592'], 8], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control ["6943515153"]', ['6943515153'], 0], ['control ["0"]', ['0'], 2], ['control ["1"]', ['1'], 9]], [['regression ["0227566323850846"]', ['0227566323850846'], 4], ['regression ["9477"]', ['9477'], 3], ['control ["12a"]', ['12a'], None], ['control [""]', [''], None], ['control ["3"]', ['3'], 5], ['control ["95"]', ['95'], 7], ['control ["55555"]', ['55555'], 1], ['control ["9"]', ['9'], 4]], [['regression ["9795751"]', ['9795751'], 6], ['regression ["6943515153"]', ['6943515153'], 0], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["9"]', ['9'], 4], ['control ["12"]', ['12'], 3], ['control ["072"]', ['072'], 5], ['control ["36073"]', ['36073'], 5]]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["9"] | 4 | 4 | Passed |
| regression ["12"] | 3 | 3 | Passed |
| control [""] | None | None | Passed |
| control ["12a"] | None | None | Passed |
| control ["072"] | 5 | 5 | Passed |
| control ["36073"] | 5 | 5 | Passed |
| control ["98772300"] | 4 | 4 | Passed |
| control ["3370345686"] | 4 | 4 | Passed |
SHA-256 / 3cfb78588b299fbbf781fe4060d4660da319d613f51b2fd7c62b4d7cfdc8f616
Verification & scope
A deterministic, bounded teaching model of the named scheme under the stated contract; not a certified validator. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:48:39.650665+00:00.
Case digest / 831eaa1d844173de0cccaaae2d95f2d8e67a30396da0cd77fba514aa59ae4d94