Skip to content
Closed
Prev Previous commit
Next Next commit
doc: remove outdated try/catchstatements in sync
The code shows that it throws on a lack of entropy, but the note below says that it does not.
Remove outdated `try/catch`statements in sync examples about crypto.randomBytes to make it clear
  • Loading branch information
JungMinu committed Sep 27, 2015
commit 69b5fb97f0856df35e5f49c62af4df6f788509df
1 change: 1 addition & 0 deletions doc/api/crypto.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ Generates cryptographically strong pseudo-random data. Usage:
});

// sync
// Implementation of handling erros is required.
var buf = crypto.randomBytes(256);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I suggest to use const?

console.log('Have %d bytes of random data: %s', buf.length, buf);

Expand Down