{"_id":"random-bytes","_rev":"72745","name":"random-bytes","description":"URL and cookie safe UIDs","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"},{"name":"dougwilson","email":""}],"time":{"modified":"2021-06-03T10:23:50.000Z","created":"2016-01-17T07:32:57.071Z","1.0.0":"2016-01-17T07:32:57.071Z"},"users":{"ahmed-dinar":true,"mojaray2k":true},"repository":{"type":"git","url":"https://github.com/crypto-utils/random-bytes"},"versions":{"1.0.0":{"name":"random-bytes","description":"URL and cookie safe UIDs","version":"1.0.0","contributors":[{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"}],"license":"MIT","repository":{"type":"git","url":"https://github.com/crypto-utils/random-bytes"},"devDependencies":{"bluebird":"3.1.1","istanbul":"0.4.2","mocha":"2.3.4","proxyquire":"1.2.0"},"files":["LICENSE","HISTORY.md","README.md","index.js"],"engines":{"node":">= 0.8"},"scripts":{"test":"mocha --trace-deprecation --reporter spec --bail --check-leaks test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --trace-deprecation --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --trace-deprecation --reporter spec --check-leaks test/"},"keywords":["bytes","generator","random","safe"],"gitHead":"3dcd47425a3dfe858ee8debcd4db0c1222110bc3","bugs":{"url":"https://github.com/crypto-utils/random-bytes/issues"},"homepage":"https://github.com/crypto-utils/random-bytes","_id":"random-bytes@1.0.0","_shasum":"4f68a1dc0ae58bd3fb95848c30324db75d64360b","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"},{"name":"dougwilson","email":""}],"dist":{"shasum":"4f68a1dc0ae58bd3fb95848c30324db75d64360b","size":2673,"noattachment":false,"key":"/random-bytes/-/random-bytes-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/random-bytes/download/random-bytes-1.0.0.tgz"},"directories":{},"publish_time":1453015977071,"_cnpm_publish_time":1453015977071,"_hasShrinkwrap":false}},"readme":"# random-bytes\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nGenerate strong pseudo-random bytes.\n\nThis module is a simple wrapper around the Node.js core `crypto.randomBytes` API,\nwith the following additions:\n\n  * A `Promise` interface for environments with promises.\n  * For Node.js versions that do not wait for the PRNG to be seeded, this module\n    will wait a bit.\n\n## Installation\n\n```sh\n$ npm install random-bytes\n```\n\n## API\n\n```js\nvar randomBytes = require('random-bytes')\n```\n\n### randomBytes(size, callback)\n\nGenerates strong pseudo-random bytes. The `size` argument is a number indicating\nthe number of bytes to generate.\n\n```js\nrandomBytes(12, function (error, bytes) {\n  if (error) throw error\n  // do something with the bytes\n})\n```\n\n### randomBytes(size)\n\nGenerates strong pseudo-random bytes and return a `Promise`. The `size` argument is\na number indicating the number of bytes to generate.\n\n**Note**: To use promises in Node.js _prior to 0.12_, promises must be\n\"polyfilled\" using `global.Promise = require('bluebird')`.\n\n```js\nrandomBytes(18).then(function (string) {\n  // do something with the string\n})\n```\n\n### randomBytes.sync(size)\n\nA synchronous version of above.\n\n```js\nvar bytes = randomBytes.sync(18)\n```\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/random-bytes.svg\n[npm-url]: https://npmjs.org/package/random-bytes\n[node-version-image]: https://img.shields.io/node/v/random-bytes.svg\n[node-version-url]: http://nodejs.org/download/\n[travis-image]: https://img.shields.io/travis/crypto-utils/random-bytes/master.svg\n[travis-url]: https://travis-ci.org/crypto-utils/random-bytes\n[coveralls-image]: https://img.shields.io/coveralls/crypto-utils/random-bytes/master.svg\n[coveralls-url]: https://coveralls.io/r/crypto-utils/random-bytes?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/random-bytes.svg\n[downloads-url]: https://npmjs.org/package/random-bytes\n","_attachments":{},"homepage":"https://github.com/crypto-utils/random-bytes","bugs":{"url":"https://github.com/crypto-utils/random-bytes/issues"},"license":"MIT"}