New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
3.3K
decreased by-2.83%
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

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

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