Professional Documents
Culture Documents
MOD10 Ex Formula
MOD10 Ex Formula
MOD10 Ex Formula
down vote
accepted
After some research, I think I'll go with the ISO 7064 Mod 97,10 formula. It see
ms pretty solid as it is used to validate IBAN (International Bank Account Numbe
r).
The formula is very simple:
Take a number : 123456
Apply the following formula to obtain the 2 digits checksum : mod(98 - mod(numb
er * 100, 97), 97) => 76
Concat number and checksum to obtain the code => 12345676
To validate a code, verify that mod(code, 97) == 1
Test :
mod(12345676, 97) = 1 => GOOD
mod(21345676, 97) = 50 => BAD !
mod(12345678, 97) = 10 => BAD !