Socket
Socket
Sign inDemoInstall

random-key

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-key

Generating random strings (cryptographically strong) for NodeJS


Version published
Weekly downloads
10K
increased by6.01%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 29 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc