https://github.com/surpri6e/random-key
Library for create random key
https://github.com/surpri6e/random-key
random random-generation string typescript unique-key
Last synced: 3 months ago
JSON representation
Library for create random key
- Host: GitHub
- URL: https://github.com/surpri6e/random-key
- Owner: surpri6e
- License: mit
- Created: 2024-04-06T14:24:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-12T21:06:30.000Z (about 1 year ago)
- Last Synced: 2024-05-10T09:12:47.364Z (about 1 year ago)
- Topics: random, random-generation, string, typescript, unique-key
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/rkey
- Size: 50.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.org/package/rkey)
[](https://packagephobia.now.sh/result?p=rkey)
[](https://npm-stat.com/charts.html?package=rkey)# RKey
Library for create random unique key. You can use it in ECMAScript and CommonJS projects.
## All structures
### TComponentsOfKey
```ts
export type TComponentsOfKey = 'numbers' | 'letters' | 'all';
```### getRandomKey
```ts
type TGetRandomKeySignature = (length: number, components: TComponentsOfKey) => string;/**
Generate new unique key
@param {number} length length of your key
@param {TComponentsOfKey} components additional information about your key@returns {string} unique key
*/
export const getRandomKey: TGetRandomKeySignature = (length, components) => {...}
```