Created
May 26, 2015 01:15
-
-
Save yuga/8c0e4ae9e8b7700f3aa5 to your computer and use it in GitHub Desktop.
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
import Data.Char (chr) | |
import Numeric (showIntAtBase) | |
repr :: Int -> Chr | |
repr n | |
| n < 10 = chr (48 + n) | |
| n < 36 = chr (65 + n - 10) | |
| n < 62 = chr (97 + n - 36) | |
numbase62 :: (Integral a, Show a) => a -> String | |
numbase62 n = showIntAtBase 62 repr n "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment