<commit_before># random-bytes

[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]

Generate strong pseudo-random bytes.

This module is a simple wrapper around the Node.js core `crypto.randomBytes` API,
with the following additions:

  * A `Promise` interface for environments with promises.
  * For Node.js versions that do not wait for the PRNG to be seeded, this module
    will wait a bit.

## Installation

```sh
$ npm install random-bytes
```

## API

```js
var randomBytes = require('random-bytes')
```

### randomBytes(size, callback)

Generates strong pseudo-random bytes. The `size` argument is a number indicating
the number of bytes to generate.

```js
randomBytes(12, function (error, bytes) {
  if (error) throw error
  // do something with the bytes
})
```<commit_msg>docs: add preamble to installation section<commit_after># random-bytes

[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]

Generate strong pseudo-random bytes.

This module is a simple wrapper around the Node.js core `crypto.randomBytes` API,
with the following additions:

  * A `Promise` interface for environments with promises.
  * For Node.js versions that do not wait for the PRNG to be seeded, this module
    will wait a bit.

## Installation

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```sh
$ npm install random-bytes
```

## API

```js
var randomBytes = require('random-bytes')
```

### randomBytes(size, callback)

Generates strong pseudo-random bytes. The `size` argument is a number indicating
the number of bytes to generate.

```js
randomBytes(12, function (error, bytes) {
  if (error) throw error
  // do something with the bytes
})
```
{'fraction_non_alphanumeric': 0.13744930148715637, 'fraction_numerical': 0.0018026137899954935, 'mean_word_length': 4.92, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '584043', 'n_tokens_mistral': 709, 'n_tokens_neox': 676, 'n_words': 225}