Last active
June 8, 2017 02:05
-
-
Save Asbra/35314d35950cd780577cee2abc53c0ba to your computer and use it in GitHub Desktop.
Base36 string encoder/decoder
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 decode(encoded) { | |
return parseInt(encoded, 36); | |
} | |
function encode(decoded) { | |
return Number(decoded).toString(36); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment