Created
October 16, 2019 20:33
-
-
Save localstatic/46fd366e8bb6f12349fd590a4be16f37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
function randomChars(len) { | |
const numBytes = len / 2; | |
return crypto.randomFillSync(Buffer.alloc(numBytes), 0, numBytes).toString('hex'); | |
} | |
randomChars(256); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment