Created
January 26, 2018 20:45
-
-
Save necccc/9f2594c8a5a2c9247f5de9e3800a619a to your computer and use it in GitHub Desktop.
random 1024 bytes of binary data
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') | |
const fs = require('fs') | |
const util = require('util') | |
const writeFile = util.promisify(fs.writeFile) | |
const randomBytes = util.promisify(crypto.randomBytes) | |
void async function () { | |
const data = await randomBytes(1024) | |
writeFile('./random1024.bin', data) | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment