Copyright | (c) 2025 Jared Tobin |
---|---|
License | MIT |
Maintainer | Jared Tobin <jared@ppad.tech> |
Safe Haskell | None |
Language | Haskell2010 |
Data.ByteString.Base16
Description
Pure base16 encoding and decoding of strict bytestrings.
Synopsis
- encode :: ByteString -> ByteString
- decode :: ByteString -> Maybe ByteString
Documentation
encode :: ByteString -> ByteString Source #
Encode a base256 ByteString
as base16.
>>>
encode "hello world"
"68656c6c6f20776f726c64"
decode :: ByteString -> Maybe ByteString Source #
Decode a base16 ByteString
to base256.
Invalid inputs (including odd-length inputs) will produce
Nothing
.
>>>
decode "68656c6c6f20776f726c64"
Just "hello world">>>
decode "068656c6c6f20776f726c64" -- odd-length
Nothing