Click here to Skip to main content
15,918,243 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to take modulus of a large integer in javascript ?
I am doing an IBAN validation as per the IBAN Algorithm.
• IBAN: GB82 WEST 1234 5698 7654 32
• Rearrange: W E S T12345698765432 G B82
• Convert to integer: 3214282912345698765432161182
• Compute remainder: 3214282912345698765432161182 mod 97 = 1



I am unable to take the modulus of the integer 3214282912345698765432161182 in javascript.
Posted

There are several big integer libraries for JavaScript, see, for instance, this Stack Overflow quastion: "What JavaScript library can I use to manipulate big integers?"[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 29-Apr-15 9:23am    
5ed.
—SA
I use this;
https://github.com/arhs/iban.js/blob/master/iban.js[^]

But you could also look at how its done in that library.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900