Skip to content

Instantly share code, notes, and snippets.

@rcombs
Created January 11, 2015 10:47
Show Gist options
  • Save rcombs/62f9972853ee01b088c3 to your computer and use it in GitHub Desktop.
Save rcombs/62f9972853ee01b088c3 to your computer and use it in GitHub Desktop.
function unhash(target){
var letters = "acdegilmnoprstuw";
var str = "";
var max = letters.length;
while(target > 7) {
var mod = target % 37;
if (mod > max)
throw new Exception("This isn't a valid hash!");
str = letters[mod] + str;
target = (target - mod) / 37;
}
return str;
}
console.log(unhash(956446786872726));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment