Skip to content

Commit bfd2245

Browse files
calvinmetcalfCalvin Metcalf
authored andcommitted
docs: more explicit crypto.pseudoRandomBytes information
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).
1 parent fa004f3 commit bfd2245

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

doc/api/crypto.markdown

Lines changed: 3 additions & 7 deletions
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 data,
659+
it will silently return **non**-cryptographically strong data.
664660

665661
## Class: Certificate
666662

0 commit comments

Comments
 (0)