{
  "_id": "random-bytes",
  "maintainers": [
    {
      "email": "hello@blakeembrey.com",
      "name": "blakeembrey"
    },
    {
      "email": "doug@somethingdoug.com",
      "name": "dougwilson"
    }
  ],
  "keywords": [
    "bytes",
    "generator",
    "random",
    "safe"
  ],
  "dist-tags": {
    "latest": "1.0.0"
  },
  "_rev": "9-d52d86640c0a91b0d169a84ac0443a1f",
  "description": "URL and cookie safe UIDs",
  "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",
  "repository": {
    "url": "https://github.com/crypto-utils/random-bytes",
    "type": "git"
  },
  "users": {
    "mojaray2k": true,
    "ahmed-dinar": true
  },
  "bugs": {
    "url": "https://github.com/crypto-utils/random-bytes/issues"
  },
  "license": "MIT",
  "versions": {
    "1.0.0": {
      "name": "random-bytes",
      "version": "1.0.0",
      "keywords": [
        "bytes",
        "generator",
        "random",
        "safe"
      ],
      "license": "MIT",
      "_id": "random-bytes@1.0.0",
      "maintainers": [
        {
          "name": "dougwilson",
          "email": "doug@somethingdoug.com"
        }
      ],
      "contributors": [
        {
          "name": "Douglas Christopher Wilson",
          "email": "doug@somethingdoug.com"
        }
      ],
      "homepage": "https://github.com/crypto-utils/random-bytes",
      "bugs": {
        "url": "https://github.com/crypto-utils/random-bytes/issues"
      },
      "dist": {
        "shasum": "4f68a1dc0ae58bd3fb95848c30324db75d64360b",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/random-bytes/-/random-bytes-1.0.0.tgz",
        "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==",
        "signatures": [
          {
            "sig": "MEYCIQDuTarR5J1PqSA8DFC833MPfI0QkpQTmV8INFpJWv07RgIhAJ8w0jhOh8lI5s1jByvL/RUqEaPUPrY3i8K3IoydbAYq",
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
          }
        ]
      },
      "_from": ".",
      "files": [
        "LICENSE",
        "HISTORY.md",
        "README.md",
        "index.js"
      ],
      "_shasum": "4f68a1dc0ae58bd3fb95848c30324db75d64360b",
      "engines": {
        "node": ">= 0.8"
      },
      "gitHead": "3dcd47425a3dfe858ee8debcd4db0c1222110bc3",
      "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/"
      },
      "_npmUser": {
        "name": "dougwilson",
        "email": "doug@somethingdoug.com"
      },
      "repository": {
        "url": "https://github.com/crypto-utils/random-bytes",
        "type": "git"
      },
      "_npmVersion": "1.4.28",
      "description": "URL and cookie safe UIDs",
      "devDependencies": {
        "mocha": "2.3.4",
        "bluebird": "3.1.1",
        "istanbul": "0.4.2",
        "proxyquire": "1.2.0"
      },
      "directories": {}
    }
  },
  "name": "random-bytes",
  "time": {
    "created": "2016-01-17T07:32:57.071Z",
    "modified": "2026-05-20T20:10:50.650Z",
    "1.0.0": "2016-01-17T07:32:57.071Z"
  },
  "contributors": [
    {
      "name": "Douglas Christopher Wilson",
      "email": "doug@somethingdoug.com"
    }
  ],
  "readmeFilename": "README.md",
  "homepage": "https://github.com/crypto-utils/random-bytes"
}