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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.0
    128
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.0
    128
  • 2.1.0
    3,894
  • 2.0.0
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i random-bytes-readable-stream

Weekly Downloads

4,024

Version

3.0.0

License

MIT

Unpacked Size

4.3 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus