Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
This module provides access to the "base32" binary-to-text encoding as defined by RFC 4648.
This module is intended to be imported qualified
, e.g.
import qualified Codec.Base32 as B32
If you want to explictly specify which Encode
and Decode
typeclass instance is used, you can use plain Haskell2010 type-signature annotations, e.g.
>>>
(B32.encode :: ByteString -> Text) "\x00\x00"
"AAAA===="
>>>
(B32.decode :: Text -> Either String ShortByteString) "GQ5DEMA="
Right "4:20"
Alternatively, starting with GHC 8.0.1, you can also use the TypeApplications language extension:
>>>
B32.encode @ShortByteString @Text "\xFF\239"
"77XQ===="
>>>
B32.decode @Text @ShortByteString "77XQ===="
Right "\255\239"
Since: 0.3.0.0
Documentation
class Encode bin txt where Source #
Typeclass representing types for which a binary-to-text base32
encoding is defined
Instances
class Decode txt bin where Source #
Typeclass representing types for which a text-to-binary base32
decoding is defined