Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- digit36 :: Char -> Int
- digit36 x | x `elem` ['0'..'9'] = (ord x) - (ord '0')
- | x `elem` ['A'..'Z'] = (ord x) - (ord 'A') + 10
- | x `elem` ['a'..'z'] = (ord x) - (ord 'a') + 10
- base36 :: String -> Int
- base36 x = fst $ head $ readInt 36 (`elem` ['0'..'1']++['a'..'z']++['A'..'Z']) digit36 x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement