personnummer

Crates.iopersonnummer
lib.rspersonnummer
version3.1.1
sourcesrc
created_at2021-05-13 23:54:56.628448
updated_at2022-09-30 13:55:25.726522
descriptionValidate Swedish personal identity numbers
homepagehttps://personnummer.dev
repositoryhttps://github.com/personnummer/rust
max_upload_size
id397162
size23,377
Simon Sawert (bombsimon)

documentation

README

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>
Commit count: 45

cargo fmt