Repository navigation
Reject IBAN check digits 00, 01 and 99 [patch] - #439
Merged
Merged
Conversation
ISO 13616 issues check digits as 98 - (n mod 97), so only 02-98 occur. 00, 01 and 99 are congruent to 97, 98 and 02 modulo 97, so the mod-97 test alone accepted an invalid twin of every IBAN with those digits. Fixes #438 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016AQEMQSRnmweax4URvCpi3
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #438
Summary
IsIbanAttributenow rejects check digits outside 02–98 before running the mod-97 test, with the message "The value must be a valid IBAN (check digits must be 02-98)."98 - (n mod 97), so 00, 01 and 99 never occur. They are congruent to 97, 98 and 02, so the remainder test alone accepted them.Tests
Create_CheckDigitsAtEdgeOfRange_Succeeds:GB98…,GB97…,GB02WEST00000000000029still validate.Create_CheckDigitsNeverIssued_Throws:GB01WEST12340000000012,GB00WEST12340000000030,GB99WEST00000000000029throw, and the message names the check digits.Semantics.Testsuite passes (1697 passed, 8 skipped).Generated by Claude Code