-- 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 <tt>base16</tt> (see also <a>RFC 4648</a>) for strict
--   (see <a>Data.ByteString.Base16</a>) and lazy <tt>ByteString</tt>s (see
--   <a>Data.ByteString.Base16.Lazy</a>).
--   
--   See the <a>base16</a> package which provides superior encoding and
--   decoding performance as well as support for lazy, short, and strict
--   variants of <a>Text</a> and <a>ByteString</a> values. Additionally,
--   see the <a>base-encoding</a> 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 <a>ByteString</a>
--   values. For a complete Base16 encoding specification, please see
--   <a>RFC-4648 section 8</a>.
module Data.ByteString.Base16

-- | Encode a <a>ByteString</a> value in base16 (i.e. hexadecimal). Encoded
--   values will always have a length that is a multiple of 2.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   encode "foo"  == "666f6f"
--   </pre>
encode :: ByteString -> ByteString

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

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


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

-- | Encode a <a>ByteString</a> value in base16 (i.e. hexadecimal). Encoded
--   values will always have a length that is a multiple of 2.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   encode "foo"  == "666f6f"
--   </pre>
encode :: ByteString -> ByteString

-- | Decode a base16-encoded <a>ByteString</a> value. If errors are
--   encountered during the decoding process, then an error message and
--   character offset will be returned in the <tt>Left</tt> clause of the
--   coproduct.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   decode "666f6f" == Right "foo"
--   decode "66quux" == Left "invalid character at offset: 2"
--   decode "666quu" == Left "invalid character at offset: 3"
--   </pre>
decode :: ByteString -> Either String ByteString

-- | Decode a Base16-encoded <a>ByteString</a> value leniently, using a
--   strategy that never fails.
--   
--   <i>N.B.</i>: this is not RFC 4648-compliant
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   decodeLenient "666f6f" == "foo"
--   decodeLenient "66quux" == "f"
--   decodeLenient "666quu" == "f"
--   decodeLenient "666fqu" == "fo"
--   </pre>
decodeLenient :: ByteString -> ByteString
