Closed 94b1 closed 6 years ago
Thanks! :)
Hashing a random string is no better than displaying the data itself. Why not just convert the Buffer to a string directly? e.g.
const hash = crypto.randomBytes(32).toString('hex');
Note that you only need to generate 32 bytes of random data, since hexadecimal characters each contain 4 bits (half a byte) of data. The result will always be 32 characters in length, regardless of zeroes in the result. Feel free to disregard this as yak shaving, but just wanted to let you know. :)
Uses crypto.randomBytes for random seed.
Credit to sehrope