iso-random-stream

2019-08-15 admin

iso-random-stream是什么

什么是iso-random-stream,Random bytes stream for node and browser

iso-random-stream使用教程帮助文档

iso-random-stream NPM Version NPM Downloads NPM License Build Status 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

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-72591.html

文章标题:iso-random-stream

回到顶部