Skip to content

Require numeric check digits in CUSIP and SEDOL identifiers - #487

Open
xiehuanyi wants to merge 1 commit into
python-validators:masterfrom
xiehuanyi:fix/numeric-security-check-digits-20261008
Open

xiehuanyi wants to merge 1 commit into
python-validators:masterfrom
xiehuanyi:fix/numeric-security-check-digits-20261008

Conversation

@xiehuanyi

Copy link
Copy Markdown

CUSIP and SEDOL validation accepts letters or symbols in the final check-digit position when their numeric expansion happens to satisfy the checksum. For example, cusip("03783310J") and sedol("293692L") currently return True.

Require the last character to be an ASCII digit before calculating either checksum. Letters and permitted symbols remain accepted in the identifier body. Regression tests include the false positives and valid numeric-check-digit controls.

The final check digit is numeric in ANSI X9.6 §3.1 and LSEG's SEDOL technical specification §8.4–8.5.

Validation on Python 3.14.6: six regression cases fail on unmodified master; all 904 tests pass after the fix. Complete Ruff lint and Pyright checks, plus changed-file formatting checks, pass. Other interpreter versions were not run locally.

Developed, reviewed, and tested with AI assistance.

Copilot AI balanced review requested due to automatic review settings October 8, 2026 11:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants