Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 778 Bytes

README.md

File metadata and controls

27 lines (20 loc) · 778 Bytes

Personnummer

Crates.io Rust

Validate Swedish personal identity numbers with Rust.

Usage

use personnummer::Personnummer;

fn main() {
    match Personnummer::new("199001011-0017") {
        Ok(pnr) => println!("{}: {}", pnr.format().long(), pnr.valid()),
        Err(e) => panic!("Error: {}", e),
    }
}

Fore more details, see examples and/or run

$ cargo run --example personnummer <personnummer>