https://github.com/sexyoung/id-card-helper
Check ID card tools for taiwan
https://github.com/sexyoung/id-card-helper
checker generator id taiwan
Last synced: about 1 month ago
JSON representation
Check ID card tools for taiwan
- Host: GitHub
- URL: https://github.com/sexyoung/id-card-helper
- Owner: sexyoung
- License: mit
- Created: 2017-08-29T14:15:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-03T12:24:50.000Z (about 8 years ago)
- Last Synced: 2025-03-09T12:12:33.535Z (9 months ago)
- Topics: checker, generator, id, taiwan
- Language: JavaScript
- Homepage: https://sexyoung.github.io/id-card-helper
- Size: 8.7 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/sexyoung/id-card-helper) [](https://codeclimate.com/github/sexyoung/id-card-helper) [](https://codecov.io/gh/sexyoung/id-card-helper) [](https://badge.fury.io/js/id-card-helper) [](http://clayallsopp.github.io/readme-score?url=https://github.com/sexyoung/id-card-helper)
**id-card-helper** is a plugin for check ID or generate random ID. Currently it support Taiwan ID.
## Features
- Singopore
- Hong Kong
## Prepare
- yarn
- node
## Installing id-card-helper
```sh
yarn add id-card-helper
```
## Using id-card-helper
```js
import IDCardHelper from 'id-card-helper';
/* Create a id Checker */
const taiwanCard = new IDCardHelper('Taiwan');
/* Checking ID is valid */
taiwanCard.check('A123456789'); // => true
/* Generate random ID */
taiwanCard.generate(); // => 'A123456789'
/* Generate Taipei Area ID */
taiwanCard.generate({ area: 'A' }); // => 'A123456789'
/* Generate female ID */
taiwanCard.generate({ gender: 'female' }); // => 'X280697928To'
/* Generate 5 ID */
taiwanCard.generate({ count: 5 });
// => ['L189927266', 'Z156906740', 'D233324744', 'C121315321', 'R254875676']
/* Or you can combine parameters */
taiwanCard.generate({
area: 'A',
gender: 'female'
count: 3,
}); // => ['A292888280', 'A276501402', 'A28447038']
```