如何将 BBAN 账户转换为 IBAN 账户

How to transform a BBAN account to an IBAN account

问题如题,BBAN是Belgian Bank Account N个数.

我不需要它的代码,我知道它是一些简单的模加法,但我不知道具体的规则(算法)。

我只找到验证规则,没有 transformation/conversion 条规则。

谢谢

这是我的python版本,如果link of antiheadshot

中提供的算法
def get_IBAN(bban):   #bban is a string
    bb_ck = int(bban[-2:])
    dummy = bb_ck * 100000000 + bb_ck * 1000000 + 111400
    ib_ck = 98 - (dummy % 97)
    return "BE%s%s" % (ib_ck, bban)

来自https://thebasementgeek.wordpress.com/2011/03/01/calculate-iban-numbers-from-a-belgian-bank-account-number/

的算法
  1. Drop all non-alphanumerical characters from a bank account number
  2. Retrieve the last two digits (old bank account number check digit)
  3. 98-(mod97(####111400) where ## stands for the check digits, which need to be appended twice.
  4. create IBAN number by appending country code, the calculated check digits from step 3 and the the old bank account number, in that order