Skip to content

Instantly share code, notes, and snippets.

@Kielan
Created February 15, 2015 17:05
Show Gist options
  • Select an option

  • Save Kielan/8dbb57f4a307aac2105a to your computer and use it in GitHub Desktop.

Select an option

Save Kielan/8dbb57f4a307aac2105a to your computer and use it in GitHub Desktop.
top secret lulz
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