Skip to content

Check IBAN length by country - #559

Open
radixun wants to merge 1 commit into
python-validators:masterfrom
radixun:fix/555-iban-country-length
Open

radixun wants to merge 1 commit into
python-validators:masterfrom
radixun:fix/555-iban-country-length

Conversation

@radixun

@radixun radixun commented Nov 1, 2026

Copy link
Copy Markdown

iban() accepts German IBAN values with 21 or 23 characters when their checksums pass. Require the national length listed in Swift IBAN Registry 103, and reject unregistered country prefixes. National length and checksum checks do not check every national account rule or prove that an account exists.

The full test suite, including doctests and the crypto extra, passes on Linux with Python 3.14.4. Ruff, Pyright, and Bandit checks also pass.

Fixes #555.

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.

iban() accepts checksum-correct IBANs with invalid country formats

1 participant