#card #identification #china #validation #id

china_identification_card

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

10 releases

new 0.2.8 Mar 11, 2025
0.2.7 Mar 2, 2025
0.2.6 Feb 9, 2025
0.2.5 Jan 20, 2025
0.1.1 Nov 1, 2024

#312 in Authentication

Download history 3/week @ 2024-11-17 24/week @ 2024-11-24 130/week @ 2024-12-01 164/week @ 2024-12-08 2/week @ 2024-12-15 317/week @ 2025-01-19 27/week @ 2025-02-02 121/week @ 2025-02-09 7/week @ 2025-02-16 8/week @ 2025-02-23 177/week @ 2025-03-02

313 downloads per month

MIT license

6KB

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 is_valid: bool = is_valid_id_number("110101202311012176");

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 ltpp-universe root@ltpp.vip.

No runtime deps