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
Andrea Giammarchi 2016-03-18 12:22:22 +00:00 committed by James M Snell
parent 545b8fd8d8
commit ac6af73a6d
1 changed files with 1 additions and 1 deletions

View File

@ -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.