Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

License

Notifications You must be signed in to change notification settings

sindresorhus/random-bytes-readable-stream

Repository files navigation

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.

About

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

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  
Morty Proxy This is a proxified and sanitized view of the page, visit original site.