Skip to content

Commit

Permalink
feat:v0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ltpp-universe committed Jan 19, 2025
1 parent ab4a66b commit 96ecd71
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "china_identification_card"
version = "0.2.3"
version = "0.2.4"
edition = "2021"
license = "MIT"
description = "A Rust library for validating Chinese identification card numbers based on official rules and checksums."
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mod cfg;
/// use china_identification_card::*;
/// let is_valid: bool = is_valid_id_number("110101202311012176");
/// ```
#[inline]
pub fn is_valid_id_number(id_number: &str) -> bool {
// Ensure the length is 18, first 17 characters are digits, and the 18th is a digit or 'X'
if id_number.len() != 18 || !id_number[..17].chars().all(|c| c.is_digit(10)) {
Expand Down

0 comments on commit 96ecd71

Please sign in to comment.