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?
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.
So, if you want to reconstruct the IBAN code using the different old-style national components at hand, you can use the Wikipedia article as a base. Specifically, a german IBAN is built up as follows:
DEkk bbbb bbbb cccc cccc cc
where
Note: the exact format is country-dependent, the example above is for Germany
Tom's Cafe offers a full JavasScript implementation you can use in your own application, because the check sum calculation is not trivial.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With