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


-- | Fast base64 encoding and decoding for ByteStrings
--   
--   This package provides support for encoding and decoding binary data
--   according to <tt>base64</tt> (see also <a>RFC 4648</a>) for strict and
--   lazy ByteStrings.
@package base64-bytestring
@version 1.0.0.3


-- | Fast and efficient encoding and decoding of base64-encoded strings.
module Data.ByteString.Base64

-- | Encode a string into base64 form. The result will always be a multiple
--   of 4 bytes in length.
encode :: ByteString -> ByteString

-- | Decode a base64-encoded string. This function strictly follows the
--   specification in <a>RFC 4648</a>.
--   
--   (Note: this means that even <tt>"n", "rn"</tt> as line breaks are
--   rejected rather than ignored. If you are using this in the context of
--   a standard that overrules RFC 4648 such as HTTP multipart mime bodies,
--   consider using <a>decodeLenient</a>.)
decode :: ByteString -> Either String ByteString

-- | Decode a base64-encoded string. This function is lenient in following
--   the specification from <a>RFC 4648</a>, and will not generate parse
--   errors no matter how poor its input.
decodeLenient :: ByteString -> ByteString

-- | Efficiently intersperse a terminator string into another at regular
--   intervals, and terminate the input with it.
--   
--   Examples:
--   
--   <pre>
--   joinWith "|" 2 "----" = "--|--|"
--   </pre>
--   
--   <pre>
--   joinWith "\r\n" 3 "foobarbaz" = "foo\r\nbar\r\nbaz\r\n"
--   joinWith "x" 3 "fo" = "fox"
--   </pre>
joinWith :: ByteString -> Int -> ByteString -> ByteString


-- | Fast and efficient encoding and decoding of base64-encoded lazy
--   bytestrings.
module Data.ByteString.Base64.Lazy

-- | Encode a string into base64 form. The result will always be a multiple
--   of 4 bytes in length.
encode :: ByteString -> ByteString

-- | Decode a base64-encoded string. This function strictly follows the
--   specification in <a>RFC 4648</a>.
decode :: ByteString -> Either String ByteString

-- | Decode a base64-encoded string. This function is lenient in following
--   the specification from <a>RFC 4648</a>, and will not generate parse
--   errors no matter how poor its input.
decodeLenient :: ByteString -> ByteString


-- | Fast and efficient encoding and decoding of base64url-encoded strings.
module Data.ByteString.Base64.URL

-- | Encode a string into base64url form. The result will always be a
--   multiple of 4 bytes in length.
encode :: ByteString -> ByteString

-- | Decode a base64url-encoded string. This function strictly follows the
--   specification in <a>RFC 4648</a>.
decode :: ByteString -> Either String ByteString

-- | Decode a base64url-encoded string. This function is lenient in
--   following the specification from <a>RFC 4648</a>, and will not
--   generate parse errors no matter how poor its input.
decodeLenient :: ByteString -> ByteString

-- | Efficiently intersperse a terminator string into another at regular
--   intervals, and terminate the input with it.
--   
--   Examples:
--   
--   <pre>
--   joinWith "|" 2 "----" = "--|--|"
--   </pre>
--   
--   <pre>
--   joinWith "\r\n" 3 "foobarbaz" = "foo\r\nbar\r\nbaz\r\n"
--   joinWith "x" 3 "fo" = "fox"
--   </pre>
joinWith :: ByteString -> Int -> ByteString -> ByteString


-- | Fast and efficient encoding and decoding of base64-encoded lazy
--   bytestrings.
module Data.ByteString.Base64.URL.Lazy

-- | Encode a string into base64 form. The result will always be a multiple
--   of 4 bytes in length.
encode :: ByteString -> ByteString

-- | Decode a base64-encoded string. This function strictly follows the
--   specification in <a>RFC 4648</a>.
decode :: ByteString -> Either String ByteString

-- | Decode a base64-encoded string. This function is lenient in following
--   the specification from <a>RFC 4648</a>, and will not generate parse
--   errors no matter how poor its input.
decodeLenient :: ByteString -> ByteString
