#card #identification #id #china #validation

china_identification_card

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

11 releases

Uses new Rust 2024

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

#445 in Authentication

Download history 148/week @ 2024-11-30 166/week @ 2024-12-07 6/week @ 2024-12-14 316/week @ 2025-01-18 1/week @ 2025-01-25 27/week @ 2025-02-01 119/week @ 2025-02-08 9/week @ 2025-02-15 8/week @ 2025-02-22 180/week @ 2025-03-01 118/week @ 2025-03-08 48/week @ 2025-03-15

355 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