New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

arc4random

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arc4random

Native bindings for the arc4random() family of funcitons.

  • 2.1.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
decreased by-51.61%
Maintainers
1
Weekly downloads
 
Created
Source

arc4random

Native bindings for the arc4random() family of funcitons:

  • arc4random()
  • arc4random_buf(buf, nbytes)
  • arc4random_uniform(upper_bound)

Requirements

  • nodejs or iojs
  • Operating system with a native arc4random() function or libbsd:

Installation

The latest and greatest version of this software is available through npm.

npm install arc4random

Usage

const rng = require('arc4random');

// returns an integer in the range [0, 2^32)
const randomNumber = rng.arc4random();

// stores nbytes integers in the given buffer.
// each byte is an integer in the range [0, 256)
const nbytes = 255;
const buf = Buffer.alloc(nbytes);
rng.arc4random_buf(buf, nbytes);

// returns an integer in the range [0, upper_bound)
const anotherRandomNumber = rng.arc4random_uniform(16);

License

See LICENSE.md

Keywords

FAQs

Package last updated on 21 May 2018

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