rs-mrz-parser 0.1.0

A MRZ parser written in Rust
Documentation
  • Coverage
  • 0%
    0 out of 35 items documented0 out of 5 items with examples
  • Size
  • Source code size: 55.87 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.85 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • okieraised/rs-mrz-parser
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • okieraised

rs-mrz-parser

Introduction

Automatically determine and parse MRZ string in Rust

Installation

cargo add rs_mrz_parser

Example

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);
}

License

This project is licensed under the MIT License - see the LICENSE file for details