mirror of https://github.com/nodejs/node.git
doc: fix typo in synchronous randomBytes example
The string template was closed after `${buf.length}` causing a syntax error within the example. PR-URL: https://github.com/nodejs/node/pull/5781 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>pull/5781/merge
parent
545b8fd8d8
commit
ac6af73a6d
|
@ -1261,7 +1261,7 @@ there is a problem generating the bytes.
|
|||
// Synchronous
|
||||
const buf = crypto.randomBytes(256);
|
||||
console.log(
|
||||
`${buf.length}` bytes of random data: ${buf.toString('hex')});
|
||||
`${buf.length} bytes of random data: ${buf.toString('hex')}`);
|
||||
```
|
||||
|
||||
The `crypto.randomBytes()` method will block until there is sufficient entropy.
|
||||
|
|
Loading…
Reference in New Issue