You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP

arc4random

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
a

arc4random

Native bindings for the arc4random() family of funcitons.

2.1.10
latest
99

Supply Chain Security

100

Vulnerability

100

Quality

94

Maintenance

100

License

Unpopular package

Quality

This package is not very popular.

Found 1 instance in 1 package

Native code

Supply chain risk

Contains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.

Found 1 instance in 1 package

Version published
Weekly downloads
26
766.67%
Maintainers
1
Weekly downloads
 
Created
Issues
0

arc4random

Native bindings for the arc4random() family of funcitons:

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

Requirements

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

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