Skip to content

Commit ac6af73

Browse files
WebReflectionjasnell
authored andcommitted
doc: fix typo in synchronous randomBytes example
The string template was closed after `${buf.length}` causing a syntax error within the example. PR-URL: #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>
1 parent 545b8fd commit ac6af73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/crypto.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ there is a problem generating the bytes.
12611261
// Synchronous
12621262
const buf = crypto.randomBytes(256);
12631263
console.log(
1264-
`${buf.length}` bytes of random data: ${buf.toString('hex')});
1264+
`${buf.length} bytes of random data: ${buf.toString('hex')}`);
12651265
```
12661266

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

0 commit comments

Comments
 (0)