Last active
July 23, 2022 13:23
-
-
Save mrpotatoes/cebf6359705fe91ff491643cbb6b5e8d to your computer and use it in GitHub Desktop.
A cheap hash function
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
console.clear() | |
// https://www.codegrepper.com/code-examples/javascript/javascript+generate+unique+hash | |
const hash = (len) => '_' + Math.random().toString(len).substr(2, 9) | |
const hashes = (amount = 5, hashLength = 36) => new Array(amount).fill().map(e => hash(hashLength)) | |
console.log(hashes(100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment