Skip to content

Commit

Permalink
doc: fix typo in synchronous randomBytes example
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
WebReflection authored and Myles Borins committed Mar 21, 2016
1 parent d8a5a31 commit 825db16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/crypto.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,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.
Expand Down

0 comments on commit 825db16

Please sign in to comment.