#numbers #identification #id-card-number

id-card

Chinese identification card number verification, including region code, birthday, and check code

4 releases

0.1.3 Jun 15, 2021
0.1.2 May 21, 2021
0.1.1 May 18, 2021
0.1.0 May 18, 2021

#12 in #identification

Apache-2.0

360KB
6.5K SLoC

id-card

Chinese identification card number verification, including region code, birthday, and check code.

License

APL 2.0, see LICENSE file.

Installation

In Cargo.toml add

[dependencies]
id-card="0.1"

Then re-run cargo build. That fetches the dependencies and builds the code.

Usage

extern crate id_card;

fn main() {
    println!("{}", id_card::validate("440524188001010014"));//outputs: true
}

Development

Test changes before commitment.(Install nightly if it haven't been installed: rustup install nightly)

cargo clean
cargo fmt --all -- --check
cargo build
cargo +nightly bench
cargo test

Dependencies

~3.5–4.5MB
~77K SLoC