# Checksum calculation for icap address

I am integrating the new coin, for this i need to create the ICAP address. In this address generation process, we need to generate the checksum, for this how i may create the checksum. example my client give this address XE98BCCCCRB100000000 and they said here 98 is checksum. we dont have idea how it is calculated can anyone help to this checksum process.

And also we need any library for creating checksum

### Valid IBAN

It's a valid IBAN, the english Wikipedia has an explaination:

• ICAN:

``````   XE98BCCCCRB100000000
``````
• Rearange, move the prefix and checksum to the end:

`````` B C C C C R B100000000 X E98
``````
• Convert to Integer:

``````11121212122711100000000331498
``````
• Modulo from 97 must be 1:

``````11121212122711100000000331498 mod 97 = 1 Q.E.D
``````

### Calculate checksum

• Now, to calculate the checksum, you just set it to `00`, e.g.:

``````        XE00BCCCCRB100000000
``````
• Rearange, move the prefix and checksum to the end:

``````      B C C C C R B100000000 X E00
``````
• Convert to Integer:

``````     11121212122711100000000331400
``````
• Calculate modulo from 97 and subtract that from 98:

``````98 - 11121212122711100000000331400 mod 97 = 98
``````