Crates.io | iso_iec_7064 |
lib.rs | iso_iec_7064 |
version | 0.1.1 |
source | src |
created_at | 2021-09-13 12:55:49.630472 |
updated_at | 2022-05-29 18:22:56.597353 |
description | Support for check digit operations conforming to ISO/IEC 7064 |
homepage | |
repository | https://github.com/gnp/iso_iec_7064-rs.git |
max_upload_size | |
id | 450538 |
size | 36,682 |
Conforming implementation of ISO/IEC 7064:2003 "Information technology — Security techniques — Check character systems" (The Standard).
This crate implements all the Check Character Systems specified in The Standard.
Note that the Mod97_10
system is used by ISO 17442-1:2020
"Financial services — Legal entity identifier (LEI) — Part 1: Assignment", which is implemented
by the lei
crate.
Add this to your Cargo.toml
:
[dependencies]
iso_iec_7064 = "0.1"
use iso_iec_7064::{Mod11_2, PureCheckCharacterSystem};
fn main() -> () {
let string = "07940";
let result = Mod11_2::validate(string);
if result {
println!("{:?} IS valid according to {}", string, Mod11_2::NAME);
} else {
println!("{:?} is NOT valid according to {}", string, Mod11_2::NAME);
}
}
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.