Created
February 2, 2017 02:34
-
-
Save zrobit/cfb2eeea6349d2d3054f9f2feec4b98c to your computer and use it in GitHub Desktop.
KISS hash generetor (don't use if avoid hash collision is super necessary)
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
| const ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
| const LENGTH = 8; | |
| function hash() { | |
| let tmp = ''; | |
| for (let i = 0; i < LENGTH; i++) { | |
| tmp += ALPHABET.charAt(Math.floor(Math.random() * ALPHABET.length)); | |
| } | |
| return tmp; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment