You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The iban module returns 'BE41091811735141' as a valid iban, whilst it is not, because it does not have a valid account number check (Using https://www.ibancalculator.com/iban_validieren.html as validator shows the error)
Here is a psuedo-code representation of how an account number should be checked:
Belgian IBAN number: BEkk BBBC CCCC CCxx (16 characters)
k = check digit for the entire IBAN
B = bank code
C = Account Number
x = check digit for the Account Number
Example: BE68 5390 0754 7034
ISO Country Code = BE (Belgium)
IBAN Check Digits = 68
BBAN = 5390 0754 7034 -> 12 characters, the usual BBAN format = 999-9999999-99
Bank Identifier = 539
Account Number = 0075470
Account Number check digits = 34 -> 2 digits MOD97
Check algorithm which is applied on the account number
The entered check digit (CD1) is the last two digits of the Account Number.
The calculated check digit (CD2) is derived by concatenating the first two sections of the Account Number and calculating the remainder on dividing this by 97. If the remainder is equal to '0', then the calculated check digit is taken to be '97'.
If the entered check digit (CD1) and calculated check digit (CD2) are equal, then the Account Number is valid, else the check has failed.
Additionally, if the entered check digit (that is, the last section) is '00', then the Account Number is invalid because the calculated check digit can never be '00' as per the 3rd point.
Example using Account Number '123-4567890-78':
The entered check digit (CD1) is '78'.
The concatenation of the first two sections gives '1234567890'.
Divide the result by '97'.
1234567890 / 97 = 12727504
Derive the remainder.
1234567890 - (12727504 * 97) = 2
Therefore CD2 = 2.
Here CD1 <> CD2, therefore the Account Number is not valid.
In this case, a valid Account Number would be '123-4567890-02'.
The text was updated successfully, but these errors were encountered:
python-stdnum only includes extra country-specific IBAN checks for a couple of countries because the check algorithms are not very well documented in all cases.
The extra check for Belgian IBANs was implemented in 56002fa. It also includes a check to see if the bank identifier refers to a registered bank.
Thanks for pointing this out.
The iban module returns 'BE41091811735141' as a valid iban, whilst it is not, because it does not have a valid account number check (Using https://www.ibancalculator.com/iban_validieren.html as validator shows the error)
Here is a psuedo-code representation of how an account number should be checked:
Belgian IBAN number: BEkk BBBC CCCC CCxx (16 characters)
k = check digit for the entire IBAN
B = bank code
C = Account Number
x = check digit for the Account Number
Example: BE68 5390 0754 7034
ISO Country Code = BE (Belgium)
IBAN Check Digits = 68
BBAN = 5390 0754 7034 -> 12 characters, the usual BBAN format = 999-9999999-99
Bank Identifier = 539
Account Number = 0075470
Account Number check digits = 34 -> 2 digits MOD97
Check algorithm which is applied on the account number
The entered check digit (CD1) is the last two digits of the Account Number.
The calculated check digit (CD2) is derived by concatenating the first two sections of the Account Number and calculating the remainder on dividing this by 97. If the remainder is equal to '0', then the calculated check digit is taken to be '97'.
If the entered check digit (CD1) and calculated check digit (CD2) are equal, then the Account Number is valid, else the check has failed.
Additionally, if the entered check digit (that is, the last section) is '00', then the Account Number is invalid because the calculated check digit can never be '00' as per the 3rd point.
Example using Account Number '123-4567890-78':
The entered check digit (CD1) is '78'.
The concatenation of the first two sections gives '1234567890'.
Divide the result by '97'.
1234567890 / 97 = 12727504
Derive the remainder.
1234567890 - (12727504 * 97) = 2
Therefore CD2 = 2.
Here CD1 <> CD2, therefore the Account Number is not valid.
In this case, a valid Account Number would be '123-4567890-02'.
The text was updated successfully, but these errors were encountered: