CBU (Clave Bancaria Uniforme, Argentine bank account number).

CBU it s a code of the Banks of Argentina to identify customer accounts. The number consists of 22 digits and consists of a 3 digit bank identiefyer, followed by a 4 digit branch identifyer, a check digit, a 13 digit account identifyer and another check digit.

More information:

>>> validate('2850590940090418135201')
>>> format('2850590940090418135201')
'28505909 40090418135201'
>>> validate('2810590940090418135201')
Traceback (most recent call last):
InvalidChecksum: ...

Calculate the check digit.

Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.

Reformat the number to the standard presentation format.

Check if the number is a valid CBU.

Check if the number is a valid CBU.