rkey
Version:
library for create random key
31 lines (21 loc) • 1.09 kB
Markdown
[](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) => {...}
```