Validate Swedish personal identity numbers with Rust.
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>