Skip to content

Instantly share code, notes, and snippets.

@msharp
Created March 14, 2011 04:03
Show Gist options
  • Save msharp/868742 to your computer and use it in GitHub Desktop.
Save msharp/868742 to your computer and use it in GitHub Desktop.
recursive base52 [a-Z] number encoding
function encode52(c) {
return (c < 52 ? '' : encode52(parseInt(c / 52))) + ((c = c % 52) > 25 ? String.fromCharCode(c + 39) : String.fromCharCode(c + 97));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment