From d481bb68c4f2cf01ec7d26dcc91862b265b7effa Mon Sep 17 00:00:00 2001 From: Calvin Metcalf Date: Wed, 21 Jan 2015 16:34:38 -0500 Subject: [PATCH] doc: more explicit crypto.pseudoRandomBytes docs 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: https://github.com/iojs/io.js/pull/545 Reviewed-By: Ben Noordhuis --- doc/api/crypto.markdown | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown index 25c2f75..4753209 100644 --- a/doc/api/crypto.markdown +++ b/doc/api/crypto.markdown @@ -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 -- 2.7.4