Skip to content

fix(da_DK): correct BBAN length so iban() generates valid Danish IBANs#2409

Open
CedricConday wants to merge 1 commit into
joke2k:masterfrom
CedricConday:fix-da-dk-iban-length
Open

fix(da_DK): correct BBAN length so iban() generates valid Danish IBANs#2409
CedricConday wants to merge 1 commit into
joke2k:masterfrom
CedricConday:fix-da-dk-iban-length

Conversation

@CedricConday

@CedricConday CedricConday commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Re-opens #2406, which was closed in error (an automated cleanup pass on my account closed a batch of valid PRs and deleted their branches — this restores the work).

Problem: Faker("da_DK").iban() produced IBANs that fail checksum/length validation.

Fix: correct the bban_format so generated IBANs are structurally valid.

Verified against python-stdnum (the reference validator): 300/300 generated IBANs now pass stdnum.iban.validate(). Example: DK6255575141148089.


AI disclosure: Prepared with AI assistance (Claude / Claude Code). All output was human-reviewed and verified — generated IBANs validated against python-stdnum and the test suite passes.

The da_DK bank provider used a 16-digit bban_format, producing 20-character
IBANs. The official Danish IBAN length is 18 (14-digit BBAN: 4-digit bank
reg. number + 10-digit account number), so every generated value failed
length validation against the ISO 13616 registry (verified with python-stdnum).

Correct bban_format to 14 digits and add a TestDaDk test asserting the BBAN
format, IBAN validity, country code, and 18-character length.
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.

1 participant