Function iban::validate_iban
[−]
[src]
pub fn validate_iban(address: &str) -> bool
Validate an IBAN number. The validation will detect the following mistakes:
- The length is four or less, or longer than 34.
- The number contains characters other than A-Z or 0-9
- A-Z is in place of 0-9 or vice versa
- The checksum is invalid
validate_iban_country
.
Examples
use iban::validate_iban; // A valid address assert_eq!(validate_iban("DE44500105175407324931"), true); // An invalid address assert_eq!(validate_iban("DE4450010234607324931"), false);