https://github.com/shimohq/guid
A Guid generator and validator.
https://github.com/shimohq/guid
Last synced: 6 months ago
JSON representation
A Guid generator and validator.
- Host: GitHub
- URL: https://github.com/shimohq/guid
- Owner: shimohq
- License: mit
- Created: 2015-10-16T10:39:48.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-19T13:08:41.000Z (over 9 years ago)
- Last Synced: 2025-04-02T10:07:18.802Z (6 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# guid
A Guid generator and validator.###
THIS 'GUID' FORMAT LIKE 'Il9Bq9ZXtojcdPNm'(REG: /^[A-Za-z0-9]+$/).## Example && APIS
```javascriptconst Guid = require('shimo-guid');
Guid.isGuid('Il9Bq9ZXtojcdPNm'); // true
Guid.fromInt(10000); // 'lS', the first argument must be an unsigned integer
Guid.toInt('BAC'); // 1 * 62 * 62 + 0 + 2 = 3846
Guid.new(16); // generate a new one, default length is 16```
## To begin1. Install it:
```bash
$ npm install shimo-guid --save
```
2. Require it and use:```js
var Guid = require('shimo-guid');
var guid = Guid.new();
```## License
MIT © ChuXin Tech