Skip to content

Instantly share code, notes, and snippets.

@thejefflarson
Created May 3, 2013 16:10
Show Gist options
  • Select an option

  • Save thejefflarson/5510481 to your computer and use it in GitHub Desktop.

Select an option

Save thejefflarson/5510481 to your computer and use it in GitHub Desktop.
var alpha = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
function convert(string){
var pow = 0;
var res = 0;
while(pow < string.length){
res += (alpha.indexOf(string.split("")[pow]) + 1) * Math.pow(37, pow);
pow++;
}
return res;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment