# random-key

> Generating random strings (cryptographically strong) for NodeJS

Latest version **0.3.2** (published 2014-12-29) · BSD license · 0 weekly downloads

## Install

```sh
npm install random-key
pnpm add random-key
yarn add random-key
bun add random-key
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2014-12-29 |
| First published | 2014-07-19 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | yanxi |
| Maintainers | yanxi |
| Keywords | random, base62, base30, human-key |

## Links

- npm: https://www.npmjs.com/package/random-key
- Repository: https://github.com/yanxi-com/nodejs-random-key
- Issues: https://github.com/yanxi-com/nodejs-random-key/issues
- npm.io page: https://npm.io/package/random-key

## Recent versions

- 0.3.2 (latest) — 2014-12-29
- 0.3.1 — 2014-12-22
- 0.3.0 — 2014-12-22
- 0.2.1 — 2014-07-20
- 0.2.0 — 2014-07-20
- 0.1.6 — 2014-07-19
- 0.1.3 — 2014-07-19
- 0.1.2 — 2014-07-19
- 0.1.1 — 2014-07-19
- 0.1.0 — 2014-07-19

## README

# nodejs-random-key

## Installation

    $ npm install random-key

## API
### generate([len], [keys])
Generate cryptographically strong pseudo-random string, with given length.
* len: the length of the generated string, default is 16
* keys: optional keys, default is base62, including: 0-9, a-z, A-Z

### generateDigits([len])
Generate random digits, with given length. optional keys: 0-9
* len: the length of the generated string, default is 16

### generateBase30([len])
Generate random string that is easy to read by human, with given length.

optional keys: 1-9, A-Z exclude(E, G, I, J, O) for human read
* len: the length of the generated string, default is 16

## Usage for JS

```javascript
var rand = require("random-key");

rand.generate(); // => eg: wexO23UXGezfTKHc

rand.generate(7); // => TShNQGc

rand.generateDigits(5);  // => 08297

rand.generateBase30(5);  // => K5UJ1
```

## LICENSE

nodejs-random-string is licensed under the BSD license.

---
_Source: https://npm.io/package/random-key · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
