Created
February 25, 2018 06:06
-
-
Save zetashift/31b8ec0aed2fc47b0e723b925a5cb50a to your computer and use it in GitHub Desktop.
DailyProgrammer #352 [EASY]
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
const | |
alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ " | |
proc base62(input: int): string = | |
result = "" | |
var q = input | |
while q != 0: | |
var i = q mod 62 | |
q = q div 62 | |
result = result & alphabet[i] | |
echo(base62(187621)) #90M |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment