calculate european iban with javascript

rubo77 picture rubo77 · Jun 19, 2013 · Viewed 15.1k times · Source

I have the german "Bankleitzahl" and the account number, now I would like to calculate the corresponding IBAN with javascript, so I don't have to enter my banking-data on an untrustworthy website.

How would I calculate this with javascript on my own client?

Answer

PhoneixS picture PhoneixS · Jan 21, 2014

I have found a project in github https://github.com/arhs/iban.js that make checking of IBAN a very easy stuff.

Is something like:

<script src="iban.js"></script>
<script>
    // the API is now accessible from the window.IBAN global object
    IBAN.isValid('hello world'); // false
    IBAN.isValid('BE68539007547034'); // true
</script>

Is licensed under the MIT license so you can check how it do the validation and try to use it to generate your IBAN.