Socket
Socket
Sign inDemoInstall

crypto-random

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    crypto-random

A cryptographically strong random number generator. Designed to be a drop-in replacement for Math.random. Can be used with Node or in a browser.


Version published
Weekly downloads
404
increased by31.17%
Maintainers
1
Install size
6.56 kB
Created
Weekly downloads
 

Readme

Source

Crypto-Random

tests

A zero dependency, cryptographically strong, random number generator.

Designed to be a drop-in replacement for Math.random. Can be used with Node or in the browser.

Supported Versions

  • Node 14.x+ (up to Node 18.x)
  • For supported browsers please refer to this MDN article.

Install

npm i crypto-random

Usage

const Random = require('crypto-random');

console.log(Random.value()); // a random float between 0 and 1. Replacement function for Math.random.
console.log(Random.range(10, 101)); // a random integer between 10 and 101.

Contributing

Feedback and any contributions are very welcome. Please open up an Issue or a Pull Request.

Keywords

FAQs

Last updated on 09 Aug 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc