Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "hkid", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Generate and Validate HKID", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -7,1 +7,24 @@ # hkid | ||
[![codecov](https://codecov.io/gh/tsekityam/hkid/branch/main/graph/badge.svg?token=34ZuXbF3md)](https://codecov.io/gh/tsekityam/hkid) | ||
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftsekityam%2Fhkid.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftsekityam%2Fhkid?ref=badge_shield) | ||
## Installation | ||
`yarn add hkid` | ||
## Usage | ||
```ts | ||
import * as hkid from "hkid"; | ||
// generate valid HKID randomly | ||
console.log(hkid.random()); | ||
// validate HKID | ||
console.log(hkid.validate("h349781(0)")); // false | ||
console.log(hkid.validate("H349781(1)")); // true | ||
console.log(hkid.validate("h349781(1)")); // true, case doesn't matter | ||
console.log(hkid.validate("H3497811")); // true, brackets is optional | ||
``` | ||
## License | ||
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftsekityam%2Fhkid.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftsekityam%2Fhkid?ref=badge_large) |
29
11595
7
193