Skip to content

Commit

Permalink
doc: more explicit crypto.pseudoRandomBytes docs
Browse files Browse the repository at this point in the history
Updates the docs for the crypto.pseudoRandomBytes function
to more explicitly detail how it's the same as crypto.randomBytes
just without a safety net (e.g. it doesn't throw an error when
there is low entropy).

PR-URL: #545
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
calvinmetcalf authored and bnoordhuis committed Jan 22, 2015
1 parent 7d46247 commit d481bb6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions doc/api/crypto.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -654,13 +654,9 @@ are drained.

## crypto.pseudoRandomBytes(size[, callback])

Generates *non*-cryptographically strong pseudo-random data. The data
returned will be unique if it is sufficiently long, but is not
necessarily unpredictable. For this reason, the output of this
function should never be used where unpredictability is important,
such as in the generation of encryption keys.

Usage is otherwise identical to `crypto.randomBytes`.
Identical to `crypto.randomBytes` except that, instead of throwing an error when
there is not enough accumulated entropy to generate cryptographically strong
data, it will silently return **non**-cryptographically strong data.

## Class: Certificate

Expand Down

0 comments on commit d481bb6

Please sign in to comment.