FAILURE MAP
← Case archive

FA-72546 / Check-digit algorithms / Open access

CUSIP rejects private-placement symbols · case 01

Private-placement numbers containing *, @ or # are reported malformed.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The payload alphabet omits the three symbols that take values 36-38.

VERIFIED REPAIR

Accept *, @ and # with values 36, 37 and 38.

Unsuccessful approach: Accepting the symbols with values 0-2 treats them as digits and computes wrong checks.

Case contract

CUSIP check: nine ASCII characters, the ninth a digit. Payload values: digits face value, A-Z 10-35, * 36, @ 37, # 38 (anything else "malformed"). Every second payload character (1-based even position) is doubled, and the decimal digits of each value are summed. Return [(10 - sum % 10) % 10, whether it equals the ninth digit].

Why this case matters

Clearing and custody systems validate North American security identifiers.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s):
    if len(s) != 9 or not s.isascii() or not s[8].isdigit():
        return 'malformed'
    total = 0
    for i, ch in enumerate(s[:8]):
        if ch.isdigit():
            v = int(ch)
        elif 'A' <= ch <= 'Z':
            v = ord(ch) - 55
        elif ch in '':
            v = 36 + '*@#'.index(ch)
        else:
            return 'malformed'
        if i % 2 == 1:
            v *= 2
        total += v // 10 + v % 10
    check = (10 - total % 10) % 10
    return [check, check == int(s[8])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["317997MK3"]', ['317997MK3'], [7, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["624143L53"]', ['624143L53'], [0, False]], ['control ["7900294Q7"]', ['7900294Q7'], [2, False]], ['control ["161949AV8"]', ['161949AV8'], [4, False]]], [['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['control ["161949AV8"]', ['161949AV8'], [4, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["907215RM1"]', ['907215RM1'], [1, True]], ['control ["088857YN7"]', ['088857YN7'], [1, False]], ['control ["462107IA0"]', ['462107IA0'], [3, False]], ['control ["6OZ44LI17"]', ['6OZ44LI17'], [5, False]]], [['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['control ["6OZ44LI17"]', ['6OZ44LI17'], [5, False]], ['control ["V0SRK56U5"]', ['V0SRK56U5'], [2, False]], ['control ["U243EIXI1"]', ['U243EIXI1'], [4, False]], ['control ["6PI3M7KT7"]', ['6PI3M7KT7'], [0, False]], ['control ["8G0MH4QH6"]', ['8G0MH4QH6'], [8, False]], ['control ["KU9BYOL70"]', ['KU9BYOL70'], [2, False]]], [['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['control ["KU9BYOL70"]', ['KU9BYOL70'], [2, False]], ['control ["XIXEC2WW3"]', ['XIXEC2WW3'], [7, False]], ['control ["037833100"]', ['037833100'], [0, True]], ['control ["38259P508"]', ['38259P508'], [8, True]], ['control ["594918104"]', ['594918104'], [4, True]], ['control ["17275R102"]', ['17275R102'], [2, True]]], [['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['control ["17275R102"]', ['17275R102'], [2, True]], ['control ["68389X105"]', ['68389X105'], [5, True]], ['control ["037833101"]', ['037833101'], [0, False]], ['control ["03783310"]', ['03783310'], 'malformed'], ['control ["0378331a0"]', ['0378331a0'], 'malformed'], ['control ["ZZZZZZZZ0"]', ['ZZZZZZZZ0'], [0, True]]]]
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 fixtureActualExpectedOutcome
regression ["7WKYMG#Y7"]malformed[3, False]Failed
regression ["123456*@0"]malformed[6, False]Failed
control ["595693682"][0, False][0, False]Passed
control ["317997MK3"][7, False][7, False]Passed
control ["445197417"][1, False][1, False]Passed
control ["624143L53"][0, False][0, False]Passed
control ["7900294Q7"][2, False][2, False]Passed
control ["161949AV8"][4, False][4, False]Passed

SHA-256 / fff6499073a8beac7172f3e306db86f8be852202957966a7d5de35f406cd8aaa

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s):
    if len(s) != 9 or not s.isascii() or not s[8].isdigit():
        return 'malformed'
    total = 0
    for i, ch in enumerate(s[:8]):
        if ch.isdigit():
            v = int(ch)
        elif 'A' <= ch <= 'Z':
            v = ord(ch) - 55
        elif ch in '*@#':
            v = '*@#'.index(ch)
        else:
            return 'malformed'
        if i % 2 == 1:
            v *= 2
        total += v // 10 + v % 10
    check = (10 - total % 10) % 10
    return [check, check == int(s[8])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["317997MK3"]', ['317997MK3'], [7, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["624143L53"]', ['624143L53'], [0, False]], ['control ["7900294Q7"]', ['7900294Q7'], [2, False]], ['control ["161949AV8"]', ['161949AV8'], [4, False]]], [['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['control ["161949AV8"]', ['161949AV8'], [4, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["907215RM1"]', ['907215RM1'], [1, True]], ['control ["088857YN7"]', ['088857YN7'], [1, False]], ['control ["462107IA0"]', ['462107IA0'], [3, False]], ['control ["6OZ44LI17"]', ['6OZ44LI17'], [5, False]]], [['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['control ["6OZ44LI17"]', ['6OZ44LI17'], [5, False]], ['control ["V0SRK56U5"]', ['V0SRK56U5'], [2, False]], ['control ["U243EIXI1"]', ['U243EIXI1'], [4, False]], ['control ["6PI3M7KT7"]', ['6PI3M7KT7'], [0, False]], ['control ["8G0MH4QH6"]', ['8G0MH4QH6'], [8, False]], ['control ["KU9BYOL70"]', ['KU9BYOL70'], [2, False]]], [['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['control ["KU9BYOL70"]', ['KU9BYOL70'], [2, False]], ['control ["XIXEC2WW3"]', ['XIXEC2WW3'], [7, False]], ['control ["037833100"]', ['037833100'], [0, True]], ['control ["38259P508"]', ['38259P508'], [8, True]], ['control ["594918104"]', ['594918104'], [4, True]], ['control ["17275R102"]', ['17275R102'], [2, True]]], [['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['control ["17275R102"]', ['17275R102'], [2, True]], ['control ["68389X105"]', ['68389X105'], [5, True]], ['control ["037833101"]', ['037833101'], [0, False]], ['control ["03783310"]', ['03783310'], 'malformed'], ['control ["0378331a0"]', ['0378331a0'], 'malformed'], ['control ["ZZZZZZZZ0"]', ['ZZZZZZZZ0'], [0, True]]]]
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 fixtureActualExpectedOutcome
regression ["7WKYMG#Y7"][2, False][3, False]Failed
regression ["123456*@0"][4, False][6, False]Failed
control ["595693682"][0, False][0, False]Passed
control ["317997MK3"][7, False][7, False]Passed
control ["445197417"][1, False][1, False]Passed
control ["624143L53"][0, False][0, False]Passed
control ["7900294Q7"][2, False][2, False]Passed
control ["161949AV8"][4, False][4, False]Passed

SHA-256 / 0a25a45e73f7eda4d0a92b0922dac7ce025a680d320b22bb74ff5e1382d553ae

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s):
    if len(s) != 9 or not s.isascii() or not s[8].isdigit():
        return 'malformed'
    total = 0
    for i, ch in enumerate(s[:8]):
        if ch.isdigit():
            v = int(ch)
        elif 'A' <= ch <= 'Z':
            v = ord(ch) - 55
        elif ch in '*@#':
            v = 36 + '*@#'.index(ch)
        else:
            return 'malformed'
        if i % 2 == 1:
            v *= 2
        total += v // 10 + v % 10
    check = (10 - total % 10) % 10
    return [check, check == int(s[8])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["317997MK3"]', ['317997MK3'], [7, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["624143L53"]', ['624143L53'], [0, False]], ['control ["7900294Q7"]', ['7900294Q7'], [2, False]], ['control ["161949AV8"]', ['161949AV8'], [4, False]]], [['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['control ["161949AV8"]', ['161949AV8'], [4, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["907215RM1"]', ['907215RM1'], [1, True]], ['control ["088857YN7"]', ['088857YN7'], [1, False]], ['control ["462107IA0"]', ['462107IA0'], [3, False]], ['control ["6OZ44LI17"]', ['6OZ44LI17'], [5, False]]], [['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['control ["6OZ44LI17"]', ['6OZ44LI17'], [5, False]], ['control ["V0SRK56U5"]', ['V0SRK56U5'], [2, False]], ['control ["U243EIXI1"]', ['U243EIXI1'], [4, False]], ['control ["6PI3M7KT7"]', ['6PI3M7KT7'], [0, False]], ['control ["8G0MH4QH6"]', ['8G0MH4QH6'], [8, False]], ['control ["KU9BYOL70"]', ['KU9BYOL70'], [2, False]]], [['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['control ["KU9BYOL70"]', ['KU9BYOL70'], [2, False]], ['control ["XIXEC2WW3"]', ['XIXEC2WW3'], [7, False]], ['control ["037833100"]', ['037833100'], [0, True]], ['control ["38259P508"]', ['38259P508'], [8, True]], ['control ["594918104"]', ['594918104'], [4, True]], ['control ["17275R102"]', ['17275R102'], [2, True]]], [['regression ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['regression ["123456*@0"]', ['123456*@0'], [6, False]], ['control ["17275R102"]', ['17275R102'], [2, True]], ['control ["68389X105"]', ['68389X105'], [5, True]], ['control ["037833101"]', ['037833101'], [0, False]], ['control ["03783310"]', ['03783310'], 'malformed'], ['control ["0378331a0"]', ['0378331a0'], 'malformed'], ['control ["ZZZZZZZZ0"]', ['ZZZZZZZZ0'], [0, True]]]]
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 fixtureActualExpectedOutcome
regression ["7WKYMG#Y7"][3, False][3, False]Passed
regression ["123456*@0"][6, False][6, False]Passed
control ["595693682"][0, False][0, False]Passed
control ["317997MK3"][7, False][7, False]Passed
control ["445197417"][1, False][1, False]Passed
control ["624143L53"][0, False][0, False]Passed
control ["7900294Q7"][2, False][2, False]Passed
control ["161949AV8"][4, False][4, False]Passed

SHA-256 / fac9035477adda0a4289963cc429131bedcb6373f48c6444266aab4ff424e104

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.492690+00:00.

Case digest / b38e314e7ed23d4bb466bff9d9e68135c40d6b575f7af0f8d35c9350ed0486ee