-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | RFC 4648-compliant Base16 encodings for ByteStrings
--   
--   This package provides support for encoding and decoding binary data
--   according to base16 (see also RFC 4648) for strict
--   (see Data.ByteString.Base16) and lazy ByteStrings (see
--   Data.ByteString.Base16.Lazy).
--   
--   See the base16 package which provides superior encoding and
--   decoding performance as well as support for lazy, short, and strict
--   variants of Text and ByteString values. Additionally,
--   see the base-encoding package which provides an uniform API
--   providing conversion paths between more binary and textual types.
@package base16-bytestring
@version 1.0.2.0

-- | RFC 4648-compliant Base16 (Hexadecimal) encoding for ByteString
--   values. For a complete Base16 encoding specification, please see
--   RFC-4648 section 8.
module Data.ByteString.Base16

-- | Encode a ByteString value in base16 (i.e. hexadecimal). Encoded
--   values will always have a length that is a multiple of 2.
--   
--   
Examples:
--   
--   
--   encode "foo"  == "666f6f"
--   
encode :: ByteString -> 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 :: ByteString -> Either String ByteString

-- | 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"
--   
decodeLenient :: ByteString -> ByteString

-- | RFC 4648-compliant Base16 (Hexadecimal) encoding for lazy
--   ByteString values. For a complete Base16 encoding
--   specification, please see RFC-4648 section 8.
module Data.ByteString.Base16.Lazy

-- | Encode a ByteString value in base16 (i.e. hexadecimal). Encoded
--   values will always have a length that is a multiple of 2.
--   
--   
Examples:
--   
--   
--   encode "foo"  == "666f6f"
--   
encode :: ByteString -> 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 "666quu" == Left "invalid character at offset: 3"
--   
decode :: ByteString -> Either String ByteString

-- | 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"
--   
decodeLenient :: ByteString -> ByteString
