🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

secure-random-string

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

secure-random-string

Generates a secure random string with a given length

0.0.2
Source
npm
Version published
Weekly downloads
3.4K
-11%
Maintainers
1
Weekly downloads
 
Created
Source

secure-random-string

a node module that generates a secure random string with a given length

Usage

require it

var srs = require('secure-random-string');

generate a random string that is 32 chars long (the default)

srs(function(sr) {
	console.log(sr);
});

generate a random string that is 256 chars long

srs({length: 256}, function(sr) {
	console.log(sr);
});

generate a random string that is 20 chars long and is url safe (can be used as a url token)

srs({length: 20, urlsafe: true}, function(sr) {
	console.log(sr);
});

Keywords

secure

FAQs

Package last updated on 25 Apr 2015

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