Skip to content

Instantly share code, notes, and snippets.

@thiagodelgado111
Created July 16, 2014 17:25
Show Gist options
  • Save thiagodelgado111/c016c3d529c9cbfc2ba9 to your computer and use it in GitHub Desktop.
Save thiagodelgado111/c016c3d529c9cbfc2ba9 to your computer and use it in GitHub Desktop.
var dcrypt = function(a){
var letters = "acdegilmnoprstuw";
var str = "";
var dcrypted = false;
while(!dcrypted){
for(var i = 0; i < letters.length; i++)
{
if(a <= 7){
dcrypted = true;
break;
}
if ((a - i) % 37 == 0)
{
str = letters[i] + str;
a = (a - i) / 37;
console.log(str);
}
}
}
return str;
};
alert(dcrypt(910897038977002));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment