rk

random-key

Generating random keys for NodeJS

Showing:

Popularity

Downloads/wk

2.5K

GitHub Stars

13

Maintenance

Last Commit

7yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

BSD-2-Clause

Type Definitions

Tree-Shakeable

No?

Categories

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

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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial