| Crates.io | cn-id-card |
| lib.rs | cn-id-card |
| version | 0.1.8 |
| created_at | 2022-03-06 05:19:48.59561+00 |
| updated_at | 2023-05-23 01:58:48.366428+00 |
| description | Chinese identification card number verification, including region code, birthday, and check code. |
| homepage | |
| repository | https://github.com/cstkingkey/id-card-rust.git |
| max_upload_size | |
| id | 544376 |
| size | 335,685 |
Fork of https://github.com/Ethan1225/id-card-rust
Chinese person identification card number verification, including region code, birthday, and check code. Chinese unified social credit code verification, including check code only.
APL 2.0, see LICENSE file.
In Cargo.toml add
[dependencies]
cn-id-card="0.1"
Then re-run cargo build. That fetches the dependencies and builds
the code.
extern crate cn_id_card;
fn main() {
println!("{}", cn_id_card::validate("440524188001010014", true));//outputs: true
println!("{}", cn_id_card::validate_code("12100000400009880K", true));//outputs: true
}
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