Crate iban [−] [src]
This crate provides an easy way to validate an IBAN account number. To do this, it has two
functions, validate_iban
which validates the IBAN format, and validate_iban_country
which
validates the country specific format of the account number.
Example
The following example does a complete validation of the account number:
use iban::*; let account_number = "DE44500105175407324931"; let valid = validate_iban(account_number) && validate_iban_country(account_number) == IbanCountryResult::Valid; assert!(valid);
Enums
IbanCountryResult |
The function |
Functions
validate_iban |
Validate an IBAN number. The validation will detect the following mistakes:
validate_iban_country .
|
validate_iban_country |
Validate the BBAN part of an IBAN account number. This function will return one of three results:
validate_iban or vice versa. This function
only checks the address country code and corresponding format. To verify whether the address
fits the IBAN specification, you should also call validate_iban .
|