china_identification_card

Crates.iochina_identification_card
lib.rschina_identification_card
version1.1.12
created_at2024-11-01 00:19:00.330907+00
updated_at2025-09-08 03:41:42.704772+00
descriptionA Rust library for validating Chinese identification card numbers based on official rules and checksums.
homepage
repositoryhttps://github.com/crates-dev/china_identification_card
max_upload_size
id1431101
size17,456
尤雨东 (eastspire)

documentation

README

china_identification_card

Official Documentation

A Rust library for validating Chinese identification card numbers based on official rules and checksums.

Features

  • Validates the length and format of a Chinese identification card number
  • Calculates and verifies the checksum according to official weight factors
  • Lightweight and easy to integrate

Installation

To use this crate, you can run cmd:

cargo add china_identification_card

Examples

use china_identification_card::*;

let valid: bool = ChineseIdCard::is_valid_id_number("110101202311012176");
assert_eq!(valid, true);
let un_valid: bool = ChineseIdCard::is_invalid_id_number("110101202311012171");
assert_eq!(un_valid, true);

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Contact

For any inquiries, please reach out to the author at root@ltpp.vip.

Commit count: 40

cargo fmt