Last active
February 2, 2020 12:37
-
-
Save drosanda/53588a4ad15f5fb9ff6b5e3cff638ce1 to your computer and use it in GitHub Desktop.
Encode Integer into Alpha-numeric BASE using Javascript
This file contains hidden or 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 getAlpNumEnc(i) { | |
var str = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
var len = str.length; | |
return (i >= len ? getAlpNumEnc((i / len >> 0) - 1) : '') + str[i % len >> 0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment