iso-random-stream
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

iso-random-stream NPM Version NPM Downloads NPM License tests codecov

Random bytes stream for node and browser. Uses crypto.randomBytes(size[, callback]) in node and Crypto.getRandomValues() in the browser. We use Buffer to keep the interfaces and returns values consistent, so make sure your bundler includes buffer in the browser.

Install

$ npm install iso-random-stream

Usage

const { randomStream } = require('iso-random-stream')

randomStream('100').pipe(process.stdout)

API

randomStream(size)

Returns a stream.Readable. By default, it produces infinite data.

size

Type: number Default: Infinity

Number of random bytes to produce.

License

MIT © Hugo Dias

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.2
    15,622
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.2
    15,622
  • 2.0.1
    1
  • 2.0.0
    2,894
  • 1.1.2
    2,445
  • 1.1.1
    515
  • 1.1.0
    281
  • 1.0.0
    0

Package Sidebar

Install

npm i iso-random-stream

Weekly Downloads

21,758

Version

2.0.2

License

MIT

Unpacked Size

8.19 kB

Total Files

13

Last publish

Collaborators

  • hugomrdias