base-encoding-0.3.0.0: RFC4648 Binary-to-text encodings (e.g. base64)
Safe HaskellTrustworthy
LanguageHaskell2010

Codec.Base32Hex

Description

This module provides access to the "base32hex" binary-to-text encoding as defined by RFC 4648.

This module is intended to be imported qualified, e.g.

import qualified Codec.Base32Hex 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"
"0000===="
>>> (B32.decode :: Text -> Either String ShortByteString) "6GT34C0="
Right "4:20"

Alternatively, starting with GHC 8.0.1, you can also use the TypeApplications language extension:

>>> B32.encode @ShortByteString @Text "\xFF\239"
"VVNG===="
>>> B32.decode @Text @ShortByteString "VVNG===="
Right "\255\239"

Since: 0.3.0.0

Synopsis

Documentation

class Encode bin txt where Source #

Typeclass representing types for which a binary-to-text base32hex encoding is defined

Methods

encode :: bin -> txt Source #

Encode binary data using base32hex text encoding

Instances

Instances details
Encode ShortByteString ShortByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode ShortByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode ShortByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode ShortByteString Builder Source # 
Instance details

Defined in Codec.Base32Hex

Encode ShortByteString Builder Source # 
Instance details

Defined in Codec.Base32Hex

Encode ShortByteString Text Source # 
Instance details

Defined in Codec.Base32Hex

Encode ShortByteString Text Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString ShortByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString Builder Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString Builder Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString Text Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString Text Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString ShortByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString Builder Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString Builder Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString Text Source # 
Instance details

Defined in Codec.Base32Hex

Encode ByteString Text Source # 
Instance details

Defined in Codec.Base32Hex

Encode Builder ShortByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode Builder ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode Builder ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Encode Builder Builder Source # 
Instance details

Defined in Codec.Base32Hex

Encode Builder Builder Source # 
Instance details

Defined in Codec.Base32Hex

Encode Builder Text Source # 
Instance details

Defined in Codec.Base32Hex

Methods

encode :: Builder -> Text Source #

Encode Builder Text Source # 
Instance details

Defined in Codec.Base32Hex

Methods

encode :: Builder -> Text Source #

class Decode txt bin where Source #

Typeclass representing types for which a text-to-binary base32hex decoding is defined

Methods

decode :: txt -> Either String bin Source #

Decode binary data encoded textually as base32hex

Instances

Instances details
Decode ShortByteString ShortByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode ShortByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode ShortByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode ShortByteString Builder Source # 
Instance details

Defined in Codec.Base32Hex

Decode ByteString ShortByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode ByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode ByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode ByteString Builder Source # 
Instance details

Defined in Codec.Base32Hex

Decode ByteString ShortByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode ByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode ByteString ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode ByteString Builder Source # 
Instance details

Defined in Codec.Base32Hex

Decode Builder ShortByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Builder ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Builder ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Builder Builder Source # 
Instance details

Defined in Codec.Base32Hex

Decode Builder ShortByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Builder ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Builder ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Builder Builder Source # 
Instance details

Defined in Codec.Base32Hex

Decode Text ShortByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Text ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Text ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Text Builder Source # 
Instance details

Defined in Codec.Base32Hex

Decode Text ShortByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Text ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Text ByteString Source # 
Instance details

Defined in Codec.Base32Hex

Decode Text Builder Source # 
Instance details

Defined in Codec.Base32Hex