Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/unique-string
Generate a unique random string
https://github.com/sindresorhus/unique-string
Last synced: about 1 month ago
JSON representation
Generate a unique random string
- Host: GitHub
- URL: https://github.com/sindresorhus/unique-string
- Owner: sindresorhus
- License: mit
- Created: 2016-11-14T04:19:21.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2022-07-08T13:15:56.000Z (over 2 years ago)
- Last Synced: 2024-04-14T11:09:17.317Z (7 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 85
- Watchers: 5
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
- Security: .github/security.md
Awesome Lists containing this project
README
# unique-string
> Generate a unique random string
## Install
```
$ npm install unique-string
```## Usage
```js
import uniqueString from 'unique-string';uniqueString();
//=> 'b4de2a49c8ffa3fbee04446f045483b2'
```## API
### uniqueString()
Returns a 32 character unique string. Matches the length of MD5, which is [unique enough](https://stackoverflow.com/a/2444336/64949) for non-crypto purposes.