Created
March 14, 2011 04:03
-
-
Save msharp/868742 to your computer and use it in GitHub Desktop.
recursive base52 [a-Z] number encoding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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