doc: crypto.randomBytes does not block when async · nodejs/node@4c26913

Original file line numberDiff line numberDiff line change

@@ -1540,7 +1540,8 @@ console.log(

15401540

`${buf.length} bytes of random data: ${buf.toString('hex')}`);

15411541

```

15421542
1543-

The `crypto.randomBytes()` method will block until there is sufficient entropy.

1543+

The `crypto.randomBytes()` method will not complete until there is

1544+

sufficient entropy available.

15441545

This should normally never take longer than a few milliseconds. The only time

15451546

when generating the random bytes may conceivably block for a longer period of

15461547

time is right after boot, when the whole system is still low on entropy.