NotNotQuinn / twitch-chat-colorchanger

Changes your chat color on twitch.tv to random colors, every so often.
MIT License
11 stars 9 forks source link

[Enhancement] Use crypto.randomBytes() over loop-based generation #2

Closed jupjohn closed 1 year ago

jupjohn commented 3 years ago

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.

NotNotQuinn commented 3 years ago

Anyone can do this if they want