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

3.0.0 • Public • Published

random-bytes-readable-stream

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

import randomBytesReadableStream from '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.

Dependents (2)

Package Sidebar

Install

npm i random-bytes-readable-stream

Weekly Downloads

2,071

Version

3.0.0

License

MIT

Unpacked Size

4.3 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus