Skip to main content
Formats of money and payments, checked on strings, with their check digits where they have them.
BankDetails.kt

Cards and accounts

creditCard

creditCard() on String Checks that the string is a card number: 12 to 19 digits with a valid Luhn check digit. Spaces and dashes are not accepted. creditCard

iban

iban() on String Checks that the string is an IBAN: the length and layout of its country, and valid check digits. It is written in uppercase with no spaces, such as DE89370400440532013000. iban

bic

bic() on String Checks that the string is a BIC (SWIFT code) of 8 or 11 characters, with a known country code. It is written in uppercase, such as DEUTDEFF or DEUTDEFF500. bic

Markets and currencies

isin

isin() on String Checks that the string is an ISIN: a country code, 9 letters or digits and a valid check digit, such as US0378331005. isin

currencyCode

currencyCode() on String Checks that the string is an ISO 4217 currency code the JVM knows, such as EUR or USD. The code is in uppercase. currencyCode

Crypto

bitcoinAddress

bitcoinAddress() on String Checks that the string has the format of a Bitcoin address: legacy (1...), script (3...) or Bech32 (bc1...). Only the format is checked, not the checksum. bitcoinAddress

ethereumAddress

ethereumAddress() on String Checks that the string is an Ethereum address: 0x and 40 hexadecimal digits. The EIP-55 mixed-case checksum is not checked. ethereumAddress