https://github.com/hustcc/short-unique-string
:ab: Generate short unique id string locally, used optimize javascript code.
https://github.com/hustcc/short-unique-string
short-id short-unique-string uniqueid
Last synced: 19 days ago
JSON representation
:ab: Generate short unique id string locally, used optimize javascript code.
- Host: GitHub
- URL: https://github.com/hustcc/short-unique-string
- Owner: hustcc
- Created: 2018-09-28T12:57:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-29T01:53:09.000Z (over 6 years ago)
- Last Synced: 2025-03-18T20:22:17.352Z (about 1 month ago)
- Topics: short-id, short-unique-string, uniqueid
- Language: JavaScript
- Homepage: https://github.com/hustcc/short-unique-string
- Size: 1.95 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# short-unique-string
> Generate short unique id string locally. Generate `7921` unique id string with only length <= `2`.
[](https://travis-ci.org/hustcc/short-unique-string)
[](https://coveralls.io/github/hustcc/short-unique-string)
[](https://www.npmjs.com/package/short-unique-string)## Usage
> **npm i --save short-unique-string**
```js
var generator = require('short-unique-string');var uniqueId = generator({
number: true,
symbol: true
})uniqueId(); // '0'
// ...
uniqueId(); // 'aY'
```Only one API `generator(opts)`, opts is the unique parameter which is a pure object:
- `number`: contain number string, default is `false`.
- `symbol`: contain symbol string, default is `false`.## License
MIT@[hustcc](https://github.com/hustcc).