fork download
  1. import Data.Array
  2. import Data.Char
  3. import Data.List
  4. import Data.Tuple
  5. main :: IO ()
  6. main = putStrLn $ show n ++ "==" ++ radix62 n
  7. where
  8. n = 18446744073709551615
  9. radix62 :: (Ix a, Integral a) => a -> String
  10. radix62 n = map (char !) $ reverse $ unfoldr f n
  11. where
  12. f 0 = Nothing
  13. f x = Just $ swap $ x `divMod` radix
  14. char =
  15. listArray (0, radix - 1)
  16. "0123456789abcdefghijklnmopqrstuvwxyzABCDEFGHIJKLNMOPQRSTUVWXYZ"
  17. radix = 62
  18.  
Success #stdin #stdout 0s 6240KB
stdin
Standard input is empty
stdout
18446744073709551615==lYGhA16ahyf