2.1.10 • Published 7 years ago

arc4random v2.1.10

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

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

2.1.10

7 years ago

2.1.9

8 years ago

2.1.8

8 years ago

2.1.7

9 years ago

2.1.6

9 years ago

2.1.5

10 years ago

2.1.4

10 years ago

2.1.3

10 years ago

2.1.2

10 years ago

2.1.1

10 years ago

2.1.0

10 years ago

2.0.6

10 years ago

2.0.5

10 years ago

2.0.4

10 years ago

2.0.3

10 years ago

2.0.2

10 years ago

2.0.0

10 years ago

1.6.0

10 years ago

1.5.0

10 years ago

1.4.0

10 years ago

1.3.0

11 years ago

1.2.0

11 years ago

1.1.0

11 years ago

1.0.1

11 years ago