iso7064
ISO 7064 MOD 97-10 check characters.
Compute and validate ISO 7064 MOD 97-10 check characters — the algorithm behind
LEI codes, IBAN check digits, and
more. A faithful Rust port of the iso-7064 npm
package, plus standard validation and check-digit-generation helpers.
- Zero dependencies,
#![no_std] compute/compute_without_check(faithful to the reference)is_validandgenerate_check_digits- Differential-tested against the reference
iso-7064implementation (60k cases)
Install
[]
= "0.1"
Usage
use ;
// MOD 97 of a string:
assert_eq!;
// Generate the two check digits and validate the full code:
assert_eq!;
assert!;
// `compute_without_check` skips format validation (use it on pre-validated input):
assert_eq!;
Digits 0-9 count as 0–9 and letters A-Z as 10–35. A code is valid when its MOD 97 equals
1.
Contributors ✨
This project follows the all-contributors specification. Contributions of any kind are welcome — code, docs, bug reports, ideas, reviews! See the emoji key for how each contribution is recognized, and open a PR or issue to get involved.
Thanks goes to these wonderful people:
License
Licensed under either of MIT or Apache-2.0 at your option.