Crates.io | rs-mrz-parser |
lib.rs | rs-mrz-parser |
version | |
source | src |
created_at | 2024-12-26 04:47:08.991545 |
updated_at | 2024-12-26 04:47:08.991545 |
description | A MRZ parser written in Rust |
homepage | |
repository | https://github.com/okieraised/rs-mrz-parser |
max_upload_size | |
id | 1495401 |
Cargo.toml error: | TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Automatically determine and parse MRZ string in Rust
cargo add rs_mrz_parser
use rs_mrz_parser::constants::mrz_utils::MRZ_TYPE1;
use rs_mrz_parser::MRZParser;
fn main() {
let mrz_string: Vec<String> = vec![
"I<UTOD231458907<<<<<<<<<<<<<<<".to_string(),
"7408122F1204159UTO<<<<<<<<<<<6".to_string(),
"ERIKSSON<<ANNA<MARIA<<<<<<<<<<".to_string(),
];
let mut parser = MRZParser::new_mrz_line_parser(mrz_string);
let mrz_type = parser.get_mrz_type().unwrap();
assert_eq!(mrz_type, MRZ_TYPE1);
let result = parser.parse().unwrap();
assert_eq!(result.is_valid, true);
}
This project is licensed under the MIT License - see the LICENSE file for details