Crates.io | personnummer |
lib.rs | personnummer |
version | 3.1.1 |
source | src |
created_at | 2021-05-13 23:54:56.628448 |
updated_at | 2022-09-30 13:55:25.726522 |
description | Validate Swedish personal identity numbers |
homepage | https://personnummer.dev |
repository | https://github.com/personnummer/rust |
max_upload_size | |
id | 397162 |
size | 23,377 |
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>