Last active
December 27, 2022 16:26
-
-
Save ZakharDay/eeed2c389a62f3d25c0de17fbbe16156 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function generateHash() { | |
const symbols = ['a', 'b', 'c', 'd', 'e', 'f', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
let hash = '' | |
for (var i = 0; i < 6; i++) { | |
hash += sample(symbols) | |
} | |
return hash | |
} | |
function sample(array) { | |
return array[Math.floor(Math.random() * array.length)] | |
} | |
export { generateHash } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment