decode package:base16-bytestring

Decode a base16-encoded ByteString value. If errors are encountered during the decoding process, then an error message and character offset will be returned in the Left clause of the coproduct.

Examples:

decode "666f6f"  == Right "foo"
decode "66quux"  == Left "invalid character at offset: 2"
decode "666quux" == Left "invalid character at offset: 3"
Decode a base16-encoded ByteString value. If errors are encountered during the decoding process, then an error message and character offset will be returned in the Left clause of the coproduct.

Examples:

decode "666f6f" == Right "foo"
decode "66quux" == Left "invalid character at offset: 2"
decode "666quu" == Left "invalid character at offset: 3"
Decode a Base16-encoded ByteString value leniently, using a strategy that never fails. N.B.: this is not RFC 4648-compliant

Examples:

decodeLenient "666f6f"  == "foo"
decodeLenient "66quuxx" == "f"
decodeLenient "666quux" == "f"
decodeLenient "666fquu" -- "fo"
Decode a Base16-encoded ByteString value leniently, using a strategy that never fails. N.B.: this is not RFC 4648-compliant

Examples:

decodeLenient "666f6f" == "foo"
decodeLenient "66quux" == "f"
decodeLenient "666quu" == "f"
decodeLenient "666fqu" == "fo"