npm

Need private packages and team management tools?Check out npm Orgs. »

random-bytes-readable-stream

2.1.0 • Public • Published

random-bytes-readable-stream Build Status

Creates a readable stream producing cryptographically strong pseudo-random data using crypto.randomBytes()

It's like a cross-platform fs.createReadStream('/dev/urandom').

Install

$ npm install random-bytes-readable-stream

Usage

const randomBytesReadableStream = require('random-bytes-readable-stream');
 
randomBytesReadableStream({size: 10}).pipe(process.stdout);

API

randomBytesReadableStream([options])

Returns a stream.Readable.

By default, it produces infinite data.

options

Type: Object

size

Type: number
Default: Infinity

The total size to be produced by the stream in bytes.

License

MIT © Sindre Sorhus

install

npm i random-bytes-readable-stream

Downloadsweekly downloads

68

version

2.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability