Skip to content

Commit d481bb6

Browse files
calvinmetcalfbnoordhuis
authored andcommitted
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: #545 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 7d46247 commit d481bb6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

doc/api/crypto.markdown

+3-7
Original file line numberDiff line numberDiff line change
@@ -654,13 +654,9 @@ are drained.
654654

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

657-
Generates *non*-cryptographically strong pseudo-random data. The data
658-
returned will be unique if it is sufficiently long, but is not
659-
necessarily unpredictable. For this reason, the output of this
660-
function should never be used where unpredictability is important,
661-
such as in the generation of encryption keys.
662-
663-
Usage is otherwise identical to `crypto.randomBytes`.
657+
Identical to `crypto.randomBytes` except that, instead of throwing an error when
658+
there is not enough accumulated entropy to generate cryptographically strong
659+
data, it will silently return **non**-cryptographically strong data.
664660

665661
## Class: Certificate
666662

0 commit comments

Comments
 (0)