Created
February 15, 2015 17:05
-
-
Save Kielan/8dbb57f4a307aac2105a to your computer and use it in GitHub Desktop.
top secret lulz
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
| var hashString = "leepadg"; | |
| function hash(string) { | |
| var h = 7; | |
| var letters = "acdegilmnoprstuw"; | |
| for(i=0; i< string.length; i++) { | |
| h = (h*37+ letters.indexOf(string[i])); | |
| } | |
| console.log(h); | |
| } | |
| hash(hashString); | |
| //console.log(letters); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment