Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/magiclen/rust-tw-id-num
Check or generate Taiwan ID numbers. 檢查或是產生中華民國國民身分證統一編號(即身份證字號,而非營業人統一編號),支援新式外來人口統一證號。
https://github.com/magiclen/rust-tw-id-num
rust taiwan tw-id-num
Last synced: 28 days ago
JSON representation
Check or generate Taiwan ID numbers. 檢查或是產生中華民國國民身分證統一編號(即身份證字號,而非營業人統一編號),支援新式外來人口統一證號。
- Host: GitHub
- URL: https://github.com/magiclen/rust-tw-id-num
- Owner: magiclen
- License: mit
- Created: 2022-11-05T08:43:47.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-09-09T13:26:49.000Z (over 1 year ago)
- Last Synced: 2024-11-13T12:11:58.256Z (about 1 month ago)
- Topics: rust, taiwan, tw-id-num
- Language: Rust
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
tw-id-num
==========[![CI](https://github.com/magiclen/rust-tw-id-num/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/rust-tw-id-num/actions/workflows/ci.yml)
Check or generate Taiwan ID numbers.
檢查或是產生中華民國**國民身分證統一編號**(即**身份證字號**,而非營業人統一編號),支援**新式外來人口統一證號**。
## Usage
```rust
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.
```toml
[dependencies.tw-id-num]
version = "*"
features = ["generate"]
```## Crates.io
https://crates.io/crates/tw-id-num
## Documentation
https://docs.rs/tw-id-num
## License
[MIT](LICENSE)