https://github.com/magiclen/ts-tw-id-num
Check or generate Taiwan ID numbers. 檢查或是產生中華民國國民身分證統一編號(即身份證字號,而非營業人統一編號),支援新式外來人口統一證號。也特別支援舊式外來人口統一證號的檢查。
https://github.com/magiclen/ts-tw-id-num
taiwan tw-id-num typescript
Last synced: 5 months ago
JSON representation
Check or generate Taiwan ID numbers. 檢查或是產生中華民國國民身分證統一編號(即身份證字號,而非營業人統一編號),支援新式外來人口統一證號。也特別支援舊式外來人口統一證號的檢查。
- Host: GitHub
- URL: https://github.com/magiclen/ts-tw-id-num
- Owner: magiclen
- License: mit
- Created: 2022-10-30T14:19:54.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-22T03:32:00.000Z (over 1 year ago)
- Last Synced: 2025-08-09T17:56:12.915Z (10 months ago)
- Topics: taiwan, tw-id-num, typescript
- Language: TypeScript
- Homepage:
- Size: 240 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
tw-id-num
==========
[](https://github.com/magiclen/ts-tw-id-num/actions/workflows/ci.yml)
Check or generate Taiwan ID numbers.
檢查或是產生中華民國**國民身分證統一編號**(即**身份證字號**,而非營業人統一編號),支援**新式外來人口統一證號**。也特別支援舊式外來人口統一證號的檢查。
## Usage
```typescript
import { Mode, check, generate, checkIncludingOldResidentID } from "tw-id-num";
const id = generate(Mode.National); // e.g. "A123456789"
console.log(check(id)); // true
console.log(checkIncludingOldResidentID("HD12345678")); // true
```
## Usage for Browsers
[Source](demo.html)
[Demo Page](https://rawcdn.githack.com/magiclen/ts-tw-id-num/master/demo.html)
## License
[MIT](LICENSE)