Check or generate Taiwan ID numbers.
檢查或是產生中華民國國民身分證統一編號(即身份證字號,而非營業人統一編號),支援新式外來人口統一證號。
```rust let id = twidnum::generatenational(Some(twid_num::Sex::Male)); // e.g. "A123456789"
assert!(twidnum::check(&id)); assert!(twidnum::checknational(&id)); assert!(!twidnum::checkresident(&id)); ```
generate
FeatureThis 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.
toml
[dependencies.tw-id-num]
version = "*"
features = ["generate"]