[ 
https://issues.apache.org/jira/browse/VALIDATOR-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13885351#comment-13885351
 ] 

Sebb commented on VALIDATOR-330:
--------------------------------

Doh! 
Of course 98 and 01 are return the same remainder - they differ by the modulus 
which is 97.
There would be the same problem with 97 and 00.

However, the check digit is supposed to be the number modulus 97 subtracted 
from 98.
Since mod 97 is in the range 0-96, the check digits must be in the range 
98,97...02.
i.e. 01 and 02 are not valid as check digits.

The code does not check this currently. 
Nor does it check the length or format of the IBAN.

> IbanCheckDigit.isValid() returns True for some invalid IBANs
> ------------------------------------------------------------
>
>                 Key: VALIDATOR-330
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-330
>             Project: Commons Validator
>          Issue Type: Bug
>          Components: Routines
>    Affects Versions: 1.4.0 Release
>            Reporter: Peter Shawe
>            Assignee: Sebb
>
> For example, isValid() returns True for both of these IBANs; 
> "IE01AIBK93118702569045" and "IE98AIBK93118702569045".  The "IE98" version is 
> the correct one (confirmed with online checkers, which also fail the "IE01" 
> version).
> calculate() correctly returns "98".  As a workaround I'm calling calculate() 
> and comparing the result with the checksum in the original IBAN.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to