Crate tw_id_num

Source
Expand description

§tw-id-num

Check or generate Taiwan ID numbers.

檢查或是產生中華民國國民身分證統一編號(即身份證字號,而非營業人統一編號),支援新式外來人口統一證號

§Usage

let id = tw_id_num::generate_national(Some(tw_id_num::Sex::Male)); // e.g. "A123456789"

assert!(tw_id_num::check(&id));
assert!(tw_id_num::check_national(&id));
assert!(!tw_id_num::check_resident(&id));

§no_std and the generate Feature

This crate can be compiled without std.

In few cases, you may want to generate IDs by yourself. The generate* functions are available if the generate feature is enabled. But the feature needs std.

[dependencies.tw-id-num]
version = "*"
features = ["generate"]

Enums§

Sex
性別。

Functions§

check
檢查國民身分證統一編號或是新式外來人口統一證號。
check_national
檢查國民身分證統一編號。
check_resident
檢查新式外來人口統一證號。
generate
產生國民身分證統一編號或是新式外來人口統一證號。
generate_national
產生國民身分證統一編號。
generate_national_with_rng
產生國民身分證統一編號。
generate_resident
產生新式外來人口統一證號。
generate_resident_with_rng
產生新式外來人口統一證號。
generate_with_rng
產生國民身分證統一編號或是新式外來人口統一證號。