In the implementation of the randomHex() function a set of known hexadecimal characters is looped over and each char is picked using a random integer. To streamline this method, a call to crypto.randomBytes(byteCount) should be used in conjunction with a byte[]#toString('hex') call.
In the implementation of the
randomHex()
function a set of known hexadecimal characters is looped over and each char is picked using a random integer. To streamline this method, a call tocrypto.randomBytes(byteCount)
should be used in conjunction with abyte[]#toString('hex')
call.