pub fn validate_iban(input: &str) -> ValidationOutcomeExpand description
Validates an IBAN (ISO 13616) using the MOD-97 checksum.
Accepts the canonical compact form (no spaces) as well as the space-delimited print form. Length bounds: 15–34 characters once whitespace is stripped.
§Algorithm
- Strip all ASCII whitespace; upper-case.
- Move the first 4 characters (country + check digits) to the end.
- Map letters A-Z → 10..=35.
- The resulting integer must be congruent to 1 mod 97.
Implemented without num-bigint by walking the digit string left
to right, taking each modulo step incrementally — this keeps the
crate dependency-free for the ISO validator.
§Examples
use ssg::seo::jsonld::iso20022::validate_iban;
assert!(validate_iban("GB29NWBK60161331926819").is_valid());
assert!(!validate_iban("GB29").is_valid());