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


-- | A modern RFC 4648-compliant Base64 library
--   
--   RFC 4648-compliant Base64 with an eye towards performance and
--   modernity (additional support for RFC 7049 standards)
@package base64
@version 0.4.2.4


-- | This module contains <a>ByteString</a>-valued combinators for
--   implementing the RFC 4648 specification of the Base64 encoding format.
--   This includes lenient decoding variants, as well as internal and
--   external validation for canonicity.
module Data.ByteString.Base64

-- | Encode a <a>ByteString</a> value as Base64 <a>Text</a> with padding.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "Sun"
--   "U3Vu"
--   </pre>
encodeBase64 :: ByteString -> Text

-- | Encode a <a>ByteString</a> value as a Base64 <a>ByteString</a> value
--   with padding.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64' "Sun"
--   "U3Vu"
--   </pre>
encodeBase64' :: ByteString -> ByteString

-- | Decode a padded Base64-encoded <a>ByteString</a> value.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3Vu"
--   Right "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3V"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64 "U3V="
--   Left "non-canonical encoding detected at offset: 2"
--   </pre>
decodeBase64 :: ByteString -> Either Text ByteString

-- | Leniently decode an unpadded Base64-encoded <a>ByteString</a> value.
--   This function will not generate parse errors. If input data contains
--   padding chars, then the input will be parsed up until the first pad
--   character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3Vu"
--   "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3V"
--   "Su"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64Lenient "U3V="
--   "Su"
--   </pre>
decodeBase64Lenient :: ByteString -> ByteString

-- | Tell whether a <a>ByteString</a> value is base64 encoded.
--   
--   This function will also detect non-canonical encodings such as
--   <tt>ZE==</tt>, which are externally valid Base64url-encoded values,
--   but are internally inconsistent "impossible" values.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V"
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V="
--   False
--   </pre>
isBase64 :: ByteString -> Bool

-- | Tell whether a <a>ByteString</a> value is a valid Base64 format.
--   
--   This will not tell you whether or not this is a correct Base64url
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>ByteString</a> value, use
--   <a>isBase64</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "%"
--   False
--   </pre>
isValidBase64 :: ByteString -> Bool


-- | This module contains <a>ByteString</a>-valued combinators for
--   implementing the RFC 4648 specification of the Base64url encoding
--   format. This includes strictly padded/unpadded and lenient decoding
--   variants, as well as internal and external validation for canonicity.
module Data.ByteString.Base64.URL

-- | Encode a <a>ByteString</a> value as a Base64url <a>Text</a> value with
--   padding.
--   
--   See: <a>RFC-4648 section 5</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4="
--   </pre>
encodeBase64 :: ByteString -> Text

-- | Encode a <a>ByteString</a> as a Base64url <a>ByteString</a> value with
--   padding.
--   
--   See: <a>RFC-4648 section 5</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64' "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4="
--   </pre>
encodeBase64' :: ByteString -> ByteString

-- | Encode a <a>ByteString</a> value as Base64url <a>Text</a> without
--   padding. Note that for Base64url, padding is optional. If you call
--   this function, you will simply be encoding as Base64url and stripping
--   padding chars from the output.
--   
--   See: <a>RFC-4648 section 3.2</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64Unpadded "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4"
--   </pre>
encodeBase64Unpadded :: ByteString -> Text

-- | Encode a <a>ByteString</a> value as Base64url without padding. Note
--   that for Base64url, padding is optional. If you call this function,
--   you will simply be encoding as Base64url and stripping padding chars
--   from the output.
--   
--   See: <a>RFC-4648 section 3.2</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64Unpadded' "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4"
--   </pre>
encodeBase64Unpadded' :: ByteString -> ByteString

-- | Decode a padded Base64url encoded <a>ByteString</a> value. If its
--   length is not a multiple of 4, then padding chars will be added to
--   fill out the input to a multiple of 4 for safe decoding as
--   Base64url-encoded values are optionally padded.
--   
--   For a decoder that fails on unpadded input of incorrect size, use
--   <a>decodeBase64Unpadded</a>.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg"
--   Right "&lt;&lt;&gt;&gt;"
--   </pre>
decodeBase64 :: ByteString -> Either Text ByteString

-- | Decode an unpadded Base64url-encoded <a>ByteString</a> value. Input
--   strings are required to be unpadded, and will undergo validation prior
--   to decoding to confirm.
--   
--   In general, unless unpadded Base64url is explicitly required, it is
--   safer to call <a>decodeBase64</a>.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
decodeBase64Unpadded :: ByteString -> Either Text ByteString

-- | Decode a padded Base64url-encoded <a>ByteString</a> value. Input
--   strings are required to be correctly padded, and will be validated
--   prior to decoding to confirm.
--   
--   In general, unless padded Base64url is explicitly required, it is
--   safer to call <a>decodeBase64</a>.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
decodeBase64Padded :: ByteString -> Either Text ByteString

-- | Leniently decode an unpadded Base64url-encoded <a>ByteString</a>. This
--   function will not generate parse errors. If input data contains
--   padding chars, then the input will be parsed up until the first pad
--   character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_Pj4="
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_%%%$}Pj4"
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
decodeBase64Lenient :: ByteString -> ByteString

-- | Tell whether a <a>ByteString</a> is encoded in padded <i>or</i>
--   unpadded Base64url format.
--   
--   This function will also detect non-canonical encodings such as
--   <tt>ZE==</tt>, which are externally valid Base64url-encoded values,
--   but are internally inconsistent "impossible" values.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj"
--   False
--   </pre>
isBase64Url :: ByteString -> Bool

-- | Tell whether a <a>ByteString</a> is a valid Base64url format.
--   
--   This will not tell you whether or not this is a correct Base64url
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>ByteString</a> value, use
--   <a>isBase64Url</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "%"
--   False
--   </pre>
isValidBase64Url :: ByteString -> Bool


-- | This module contains <a>ByteString</a>-valued combinators for
--   implementing the RFC 4648 specification of the Base64 encoding format.
--   This includes lenient decoding variants, as well as internal and
--   external validation for canonicity.
module Data.ByteString.Lazy.Base64

-- | Encode a <a>ByteString</a> value as Base64 <tt>Text</tt> with padding.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "Sun"
--   "U3Vu"
--   </pre>
encodeBase64 :: ByteString -> Text

-- | Encode a <a>ByteString</a> value as a Base64 <a>ByteString</a> value
--   with padding.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64' "Sun"
--   "U3Vu"
--   </pre>
encodeBase64' :: ByteString -> ByteString

-- | Decode a padded Base64-encoded <a>ByteString</a> value.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3Vu"
--   Right "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3V"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64 "U3V="
--   Left "non-canonical encoding detected at offset: 2"
--   </pre>
decodeBase64 :: ByteString -> Either Text ByteString

-- | Leniently decode an unpadded Base64-encoded <a>ByteString</a> value.
--   This function will not generate parse errors. If input data contains
--   padding chars, then the input will be parsed up until the first pad
--   character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3Vu"
--   "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3V"
--   "Su"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64Lenient "U3V="
--   "Su"
--   </pre>
decodeBase64Lenient :: ByteString -> ByteString

-- | Tell whether a <a>ByteString</a> value is base64 encoded.
--   
--   This function will also detect non-canonical encodings such as
--   <tt>ZE==</tt>, which are externally valid Base64url-encoded values,
--   but are internally inconsistent "impossible" values.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V"
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V="
--   False
--   </pre>
isBase64 :: ByteString -> Bool

-- | Tell whether a <a>ByteString</a> value is a valid Base64 format.
--   
--   This will not tell you whether or not this is a correct Base64url
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>ByteString</a> value, use
--   <a>isBase64</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "%"
--   False
--   </pre>
isValidBase64 :: ByteString -> Bool


-- | This module contains <a>ByteString</a>-valued combinators for
--   implementing the RFC 4648 specification of the Base64url encoding
--   format. This includes strictly padded/unpadded and lenient decoding
--   variants, as well as internal and external validation for canonicity.
module Data.ByteString.Lazy.Base64.URL

-- | Encode a <a>ByteString</a> value as a Base64url <tt>Text</tt> value
--   with padding.
--   
--   See: <a>RFC-4648 section 5</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4="
--   </pre>
encodeBase64 :: ByteString -> Text

-- | Encode a <a>ByteString</a> as a Base64url <a>ByteString</a> value with
--   padding.
--   
--   See: <a>RFC-4648 section 5</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64' "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4="
--   </pre>
encodeBase64' :: ByteString -> ByteString

-- | Encode a <a>ByteString</a> value as Base64url <tt>Text</tt> without
--   padding. Note that for Base64url, padding is optional. If you call
--   this function, you will simply be encoding as Base64url and stripping
--   padding chars from the output.
--   
--   See: <a>RFC-4648 section 3.2</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64Unpadded "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4"
--   </pre>
encodeBase64Unpadded :: ByteString -> Text

-- | Encode a <a>ByteString</a> value as Base64url without padding. Note
--   that for Base64url, padding is optional. If you call this function,
--   you will simply be encoding as Base64url and stripping padding chars
--   from the output.
--   
--   See: <a>RFC-4648 section 3.2</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64Unpadded' "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4"
--   </pre>
encodeBase64Unpadded' :: ByteString -> ByteString

-- | Decode a padded Base64url encoded <a>ByteString</a> value. If its
--   length is not a multiple of 4, then padding chars will be added to
--   fill out the input to a multiple of 4 for safe decoding as
--   Base64url-encoded values are optionally padded.
--   
--   For a decoder that fails on unpadded input of incorrect size, use
--   <a>decodeBase64Unpadded</a>.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg"
--   Right "&lt;&lt;&gt;&gt;"
--   </pre>
decodeBase64 :: ByteString -> Either Text ByteString

-- | Decode an unpadded Base64url-encoded <a>ByteString</a> value. Input
--   strings are required to be unpadded, and will undergo validation prior
--   to decoding to confirm.
--   
--   In general, unless unpadded Base64url is explicitly required, it is
--   safer to call <a>decodeBase64</a>.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
decodeBase64Unpadded :: ByteString -> Either Text ByteString

-- | Decode a padded Base64url-encoded <a>ByteString</a> value. Input
--   strings are required to be correctly padded, and will be validated
--   prior to decoding to confirm.
--   
--   In general, unless padded Base64url is explicitly required, it is
--   safer to call <a>decodeBase64</a>.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
decodeBase64Padded :: ByteString -> Either Text ByteString

-- | Leniently decode an unpadded Base64url-encoded <a>ByteString</a>. This
--   function will not generate parse errors. If input data contains
--   padding chars, then the input will be parsed up until the first pad
--   character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_Pj4="
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_%%%$}Pj4"
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
decodeBase64Lenient :: ByteString -> ByteString

-- | Tell whether a <a>ByteString</a> is Base64url-encoded.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj"
--   False
--   </pre>
isBase64Url :: ByteString -> Bool

-- | Tell whether a <a>ByteString</a> is a valid Base64url format.
--   
--   This will not tell you whether or not this is a correct Base64url
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>ByteString</a> value, use
--   <a>isBase64Url</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "%"
--   False
--   </pre>
isValidBase64Url :: ByteString -> Bool


-- | This module contains <a>ShortByteString</a>-valued combinators for
--   implementing the RFC 4648 specification of the Base64 encoding format.
--   This includes lenient decoding variants, as well as internal and
--   external validation for canonicity.
module Data.ByteString.Short.Base64

-- | Encode a <a>ShortByteString</a> value as Base64 <a>ShortText</a> with
--   padding.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "Sun"
--   "U3Vu"
--   </pre>
encodeBase64 :: ShortByteString -> ShortText

-- | Encode a <a>ShortByteString</a> value as a Base64
--   <a>ShortByteString</a> value with padding.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64' "Sun"
--   "U3Vu"
--   </pre>
encodeBase64' :: ShortByteString -> ShortByteString

-- | Decode a padded Base64-encoded <a>ShortByteString</a> value.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3Vu"
--   Right "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3V"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64 "U3V="
--   Left "non-canonical encoding detected at offset: 2"
--   </pre>
decodeBase64 :: ShortByteString -> Either Text ShortByteString

-- | Leniently decode an unpadded Base64-encoded <a>ShortByteString</a>
--   value. This function will not generate parse errors. If input data
--   contains padding chars, then the input will be parsed up until the
--   first pad character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3Vu"
--   "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3V"
--   "Su"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64Lenient "U3V="
--   "Su"
--   </pre>
decodeBase64Lenient :: ShortByteString -> ShortByteString

-- | Tell whether a <a>ShortByteString</a> value is base64 encoded.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V"
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V="
--   False
--   </pre>
isBase64 :: ShortByteString -> Bool

-- | Tell whether a <a>ShortByteString</a> value is a valid Base64 format.
--   
--   This will not tell you whether or not this is a correct Base64url
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>ShortByteString</a> value, use
--   <a>isBase64</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "%"
--   False
--   </pre>
isValidBase64 :: ShortByteString -> Bool


-- | This module contains <a>ShortByteString</a>-valued combinators for
--   implementing the RFC 4648 specification of the Base64url encoding
--   format. This includes strictly padded/unpadded and lenient decoding
--   variants, as well as internal and external validation for canonicity.
module Data.ByteString.Short.Base64.URL

-- | Encode a <a>ShortByteString</a> value as a Base64url <a>Text</a> value
--   with padding.
--   
--   See: <a>RFC-4648 section 5</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4="
--   </pre>
encodeBase64 :: ShortByteString -> ShortText

-- | Encode a <a>ShortByteString</a> as a Base64url <a>ShortByteString</a>
--   value with padding.
--   
--   See: <a>RFC-4648 section 5</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64' "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4="
--   </pre>
encodeBase64' :: ShortByteString -> ShortByteString

-- | Encode a <a>ShortByteString</a> value as Base64url <a>Text</a> without
--   padding. Note that for Base64url, padding is optional. If you call
--   this function, you will simply be encoding as Base64url and stripping
--   padding chars from the output.
--   
--   See: <a>RFC-4648 section 3.2</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64Unpadded "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4"
--   </pre>
encodeBase64Unpadded :: ShortByteString -> ShortText

-- | Encode a <a>ShortByteString</a> value as Base64url without padding.
--   Note that for Base64url, padding is optional. If you call this
--   function, you will simply be encoding as Base64url and stripping
--   padding chars from the output.
--   
--   See: <a>RFC-4648 section 3.2</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64Unpadded' "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4"
--   </pre>
encodeBase64Unpadded' :: ShortByteString -> ShortByteString

-- | Decode a padded Base64url encoded <a>ShortByteString</a> value. If its
--   length is not a multiple of 4, then padding chars will be added to
--   fill out the input to a multiple of 4 for safe decoding as
--   Base64url-encoded values are optionally padded.
--   
--   For a decoder that fails on unpadded input of incorrect size, use
--   <a>decodeBase64Unpadded</a>.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg"
--   Right "&lt;&lt;&gt;&gt;"
--   </pre>
decodeBase64 :: ShortByteString -> Either Text ShortByteString

-- | Decode an unpadded Base64url-encoded <a>ShortByteString</a> value.
--   Input strings are required to be unpadded, and will undergo validation
--   prior to decoding to confirm.
--   
--   In general, unless unpadded Base64url is explicitly required, it is
--   safer to call <a>decodeBase64</a>.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
decodeBase64Unpadded :: ShortByteString -> Either Text ShortByteString

-- | Decode a padded Base64url-encoded <a>ShortByteString</a> value. Input
--   strings are required to be correctly padded, and will be validated
--   prior to decoding to confirm.
--   
--   In general, unless padded Base64url is explicitly required, it is
--   safer to call <a>decodeBase64</a>.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
decodeBase64Padded :: ShortByteString -> Either Text ShortByteString

-- | Leniently decode an unpadded Base64url-encoded <a>ShortByteString</a>.
--   This function will not generate parse errors. If input data contains
--   padding chars, then the input will be parsed up until the first pad
--   character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_Pj4="
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_%%%$}Pj4"
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
decodeBase64Lenient :: ShortByteString -> ShortByteString

-- | Tell whether a <a>ShortByteString</a> is Base64url-encoded.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj"
--   False
--   </pre>
isBase64Url :: ShortByteString -> Bool

-- | Tell whether a <a>ShortByteString</a> is a valid Base64url format.
--   
--   This will not tell you whether or not this is a correct Base64url
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>ShortByteString</a> value, use
--   <a>isBase64Url</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "%"
--   False
--   </pre>
isValidBase64Url :: ShortByteString -> Bool


-- | This module contains the error types raised (not as exceptions!) in
--   the decoding process.
module Data.Text.Encoding.Base64.Error

-- | This data type represents the type of decoding errors of various kinds
--   as they pertain to decoding <a>Text</a> values. Namely, to distinguish
--   between decoding errors from opaque unicode exceptions caught in the
--   unicode decoding process.
data Base64Error e

-- | The error associated with decoding failure as a result of the Base64
--   decoding process
DecodeError :: Text -> Base64Error e

-- | The error associated with the decoding failure as a result of the
--   conversion process
ConversionError :: e -> Base64Error e
instance GHC.Generics.Generic (Data.Text.Encoding.Base64.Error.Base64Error e)
instance GHC.Show.Show e => GHC.Show.Show (Data.Text.Encoding.Base64.Error.Base64Error e)
instance GHC.Classes.Eq e => GHC.Classes.Eq (Data.Text.Encoding.Base64.Error.Base64Error e)
instance GHC.Exception.Type.Exception e => GHC.Exception.Type.Exception (Data.Text.Encoding.Base64.Error.Base64Error e)
instance Control.DeepSeq.NFData e => Control.DeepSeq.NFData (Data.Text.Encoding.Base64.Error.Base64Error e)


-- | This module contains <a>Text</a>-valued combinators for implementing
--   the RFC 4648 specification of the Base64 encoding format. This
--   includes lenient decoding variants, as well as internal and external
--   validation for canonicity.
module Data.Text.Encoding.Base64

-- | Encode a <a>Text</a> value in Base64 with padding.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "Sun"
--   "U3Vu"
--   </pre>
encodeBase64 :: Text -> Text

-- | Decode a padded Base64-encoded <a>Text</a> value.
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <a>decodeBase64With</a> and pass in a custom decode
--   function.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3Vu"
--   Right "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3V"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64 "U3V="
--   Left "non-canonical encoding detected at offset: 2"
--   </pre>
decodeBase64 :: Text -> Either Text Text

-- | Attempt to decode a <a>Text</a> value as Base64, converting from
--   <a>ByteString</a> to <a>Text</a> according to some encoding function.
--   In practice, This is something like <tt>decodeUtf8'</tt>, which may
--   produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Example</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64With</a> <a>decodeUtf8'</a>
--     :: <a>ByteString</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <a>Text</a>
--   </pre>
decodeBase64With :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text

-- | Leniently decode a Base64-encoded <a>Text</a> value. This function
--   will not generate parse errors. If input data contains padding chars,
--   then the input will be parsed up until the first pad character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3Vu"
--   "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3V"
--   "Su"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64Lenient "U3V="
--   "Su"
--   </pre>
decodeBase64Lenient :: Text -> Text

-- | Tell whether a <a>Text</a> value is Base64-encoded.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V"
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V="
--   False
--   </pre>
isBase64 :: Text -> Bool

-- | Tell whether a <a>Text</a> value is a valid Base64 format.
--   
--   This will not tell you whether or not this is a correct Base64
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>Text</a> value, use
--   <a>isBase64</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "%"
--   False
--   </pre>
isValidBase64 :: Text -> Bool


-- | This module contains <a>Text</a>-valued combinators for implementing
--   the RFC 4648 specification of the Base64url encoding format. This
--   includes strictly padded/unpadded and lenient decoding variants, as
--   well as internal and external validation for canonicity.
module Data.Text.Encoding.Base64.URL

-- | Encode a <a>Text</a> value in Base64url with padding.
--   
--   See: <a>RFC-4648 section 5</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4="
--   </pre>
encodeBase64 :: Text -> Text

-- | Encode a <a>Text</a> value in Base64url without padding. Note that for
--   Base64url, padding is optional. If you call this function, you will
--   simply be encoding as Base64url and stripping padding chars from the
--   output.
--   
--   See: <a>RFC-4648 section 3.2</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64Unpadded "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4"
--   </pre>
encodeBase64Unpadded :: Text -> Text

-- | Decode a padded Base64url-encoded <a>Text</a> value. If its length is
--   not a multiple of 4, then padding chars will be added to fill out the
--   input to a multiple of 4 for safe decoding as base64url encodings are
--   optionally padded.
--   
--   For a decoder that fails on unpadded input, use
--   <a>decodeBase64Unpadded</a>
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <a>decodeBase64With</a> and pass in a custom decode
--   function.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg"
--   Right "&lt;&lt;&gt;&gt;"
--   </pre>
decodeBase64 :: Text -> Either Text Text

-- | Attempt to decode a <a>ByteString</a> value as Base64url, converting
--   from <a>ByteString</a> to <a>Text</a> according to some encoding
--   function. In practice, This is something like <tt>decodeUtf8'</tt>,
--   which may produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64With</a> <a>decodeUtf8'</a>
--     :: <a>Text</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <a>Text</a>
--   </pre>
decodeBase64With :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text

-- | Decode an unpadded Base64url encoded <a>Text</a> value.
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <a>decodeBase64UnpaddedWith</a> and pass in a custom
--   decode function.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
decodeBase64Unpadded :: Text -> Either Text Text

-- | Attempt to decode an unpadded <a>ByteString</a> value as Base64url,
--   converting from <a>ByteString</a> to <a>Text</a> according to some
--   encoding function. In practice, This is something like
--   <tt>decodeUtf8'</tt>, which may produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Example</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64UnpaddedWith</a> <a>decodeUtf8'</a>
--     :: <a>ByteString</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <a>Text</a>
--   </pre>
decodeBase64UnpaddedWith :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text

-- | Decode an padded Base64url encoded <a>Text</a> value
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <a>decodeBase64PaddedWith</a> and pass in a custom
--   decode function.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
decodeBase64Padded :: Text -> Either Text Text

-- | Attempt to decode a padded <a>ByteString</a> value as Base64url,
--   converting from <a>ByteString</a> to <a>Text</a> according to some
--   encoding function. In practice, This is something like
--   <tt>decodeUtf8'</tt>, which may produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Example</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64PaddedWith</a> <a>decodeUtf8'</a>
--     :: <a>ByteString</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <a>Text</a>
--   </pre>
decodeBase64PaddedWith :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text

-- | Leniently decode an unpadded Base64url-encoded <a>Text</a>. This
--   function will not generate parse errors. If input data contains
--   padding chars, then the input will be parsed up until the first pad
--   character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_Pj4="
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_%%%$}Pj4"
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
decodeBase64Lenient :: Text -> Text

-- | Tell whether a <a>Text</a> value is Base64url-encoded.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj"
--   False
--   </pre>
isBase64Url :: Text -> Bool

-- | Tell whether a <a>Text</a> value is a valid Base64url format.
--   
--   This will not tell you whether or not this is a correct Base64url
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>Text</a> value, use
--   <a>isBase64Url</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "%"
--   False
--   </pre>
isValidBase64Url :: Text -> Bool


-- | This module contains <a>Text</a>-valued combinators implementing the
--   RFC 4648 specification for the Base64 encoding format. This includes
--   lenient decoding variants, and external + internal validations for
--   canonicity.
module Data.Text.Lazy.Encoding.Base64

-- | Encode a <a>Text</a> value in Base64 with padding.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "Sun"
--   "U3Vu"
--   </pre>
encodeBase64 :: Text -> Text

-- | Decode a padded Base64-encoded <a>Text</a> value
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <a>decodeBase64With</a> and pass in a custom decode
--   function.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3Vu"
--   Right "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3V"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64 "U3V="
--   Left "non-canonical encoding detected at offset: 2"
--   </pre>
decodeBase64 :: Text -> Either Text Text

-- | Attempt to decode a <a>ByteString</a> value as Base64, converting from
--   <a>ByteString</a> to <a>Text</a> according to some encoding function.
--   In practice, This is something like <tt>decodeUtf8'</tt>, which may
--   produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Example</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64With</a> <a>decodeUtf8'</a>
--     :: <a>ByteString</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <a>Text</a>
--   </pre>
decodeBase64With :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text

-- | Leniently decode a Base64-encoded <a>Text</a> value. This function
--   will not generate parse errors. If input data contains padding chars,
--   then the input will be parsed up until the first pad character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3Vu"
--   "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3V"
--   "Su"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64Lenient "U3V="
--   "Su"
--   </pre>
decodeBase64Lenient :: Text -> Text

-- | Tell whether a <a>Text</a> value is Base64-encoded.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V"
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V="
--   False
--   </pre>
isBase64 :: Text -> Bool

-- | Tell whether a <a>Text</a> value is a valid Base64 format.
--   
--   This will not tell you whether or not this is a correct Base64
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>Text</a> value, use
--   <a>isBase64</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "%"
--   False
--   </pre>
isValidBase64 :: Text -> Bool


-- | This module contains <a>Text</a>-valued combinators for implementing
--   the RFC 4648 specification of the Base64url encoding format. This
--   includes strictly padded/unpadded and lenient decoding variants, as
--   well as internal and external validation for canonicity.
module Data.Text.Lazy.Encoding.Base64.URL

-- | Encode a <a>Text</a> value in Base64url with padding.
--   
--   See: <a>RFC-4648 section 5</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4="
--   </pre>
encodeBase64 :: Text -> Text

-- | Encode a <a>Text</a> value in Base64url without padding. Note that for
--   Base64url, padding is optional. If you call this function, you will
--   simply be encoding as Base64url and stripping padding chars from the
--   output.
--   
--   See: <a>RFC-4648 section 3.2</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64Unpadded "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4"
--   </pre>
encodeBase64Unpadded :: Text -> Text

-- | Decode a padded Base64url-encoded <a>Text</a> value. If its length is
--   not a multiple of 4, then padding chars will be added to fill out the
--   input to a multiple of 4 for safe decoding as base64url encodings are
--   optionally padded.
--   
--   For a decoder that fails on unpadded input, use
--   <a>decodeBase64Unpadded</a>.
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <a>decodeBase64With</a> and pass in a custom decode
--   function.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg"
--   Right "&lt;&lt;&gt;&gt;"
--   </pre>
decodeBase64 :: Text -> Either Text Text

-- | Attempt to decode a lazy <a>ByteString</a> value as Base64url,
--   converting from <a>ByteString</a> to <a>Text</a> according to some
--   encoding function. In practice, This is something like
--   <tt>decodeUtf8'</tt>, which may produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64With</a> <a>decodeUtf8'</a>
--     :: <a>ByteString</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <a>Text</a>
--   </pre>
decodeBase64With :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text

-- | Decode an unpadded Base64url encoded <a>Text</a> value.
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <tt>decodeBase64WUnpaddedWith</tt> and pass in a
--   custom decode function.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
decodeBase64Unpadded :: Text -> Either Text Text

-- | Attempt to decode an unpadded lazy <a>ByteString</a> value as
--   Base64url, converting from <a>ByteString</a> to <a>Text</a> according
--   to some encoding function. In practice, This is something like
--   <tt>decodeUtf8'</tt>, which may produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64UnpaddedWith</a> <a>decodeUtf8'</a>
--     :: <a>ByteString</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <a>Text</a>
--   </pre>
decodeBase64UnpaddedWith :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text

-- | Decode an padded Base64url encoded <a>Text</a> value
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <a>decodeBase64PaddedWith</a> and pass in a custom
--   decode function.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
decodeBase64Padded :: Text -> Either Text Text

-- | Attempt to decode a padded lazy <a>ByteString</a> value as Base64url,
--   converting from <a>ByteString</a> to <a>Text</a> according to some
--   encoding function. In practice, This is something like
--   <tt>decodeUtf8'</tt>, which may produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Example</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64PaddedWith</a> <a>decodeUtf8'</a>
--     :: <a>ByteString</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <tt>Text</tt>
--   </pre>
decodeBase64PaddedWith :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text

-- | Leniently decode an unpadded Base64url-encoded <a>Text</a>. This
--   function will not generate parse errors. If input data contains
--   padding chars, then the input will be parsed up until the first pad
--   character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_Pj4="
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_%%%$}Pj4"
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
decodeBase64Lenient :: Text -> Text

-- | Tell whether a <a>Text</a> value is Base64url-encoded
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj"
--   False
--   </pre>
isBase64Url :: Text -> Bool

-- | Tell whether a <a>Text</a> value is a valid Base64url format.
--   
--   This will not tell you whether or not this is a correct Base64url
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>Text</a> value, use
--   <a>isBase64Url</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "%"
--   False
--   </pre>
isValidBase64Url :: Text -> Bool


-- | This module contains <a>ShortText</a>-valued combinators implementing
--   the RFC 4648 specification for the Base64 encoding format. This
--   includes lenient decoding variants, and external + internal
--   validations for canonicity.
module Data.Text.Short.Encoding.Base64

-- | Encode a <a>ShortText</a> value in Base64 with padding.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "Sun"
--   "U3Vu"
--   </pre>
encodeBase64 :: ShortText -> ShortText

-- | Decode a padded Base64-encoded <a>ShortText</a> value
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <a>decodeBase64With</a> and pass in a custom decode
--   function.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3Vu"
--   Right "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "U3V"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64 "U3V="
--   Left "non-canonical encoding detected at offset: 2"
--   </pre>
decodeBase64 :: ShortText -> Either Text ShortText

-- | Attempt to decode a <a>ShortByteString</a> value as Base64, converting
--   from <tt>ByteString</tt> to <a>ShortText</a> according to some
--   encoding function. In practice, This is something like
--   <tt>decodeUtf8'</tt>, which may produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Example</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64With</a> <a>decodeUtf8'</a>
--     :: <a>ShortByteString</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <a>ShortText</a>
--   </pre>
decodeBase64With :: (ShortByteString -> Either err ShortText) -> ShortByteString -> Either (Base64Error err) ShortText

-- | Leniently decode a Base64-encoded <a>ShortText</a> value. This
--   function will not generate parse errors. If input data contains
--   padding chars, then the input will be parsed up until the first pad
--   character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3Vu"
--   "Sun"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "U3V"
--   "Su"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodebase64Lenient "U3V="
--   "Su"
--   </pre>
decodeBase64Lenient :: ShortText -> ShortText

-- | Tell whether a <a>ShortText</a> value is Base64-encoded.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V"
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64 "U3V="
--   False
--   </pre>
isBase64 :: ShortText -> Bool

-- | Tell whether a <a>ShortText</a> value is a valid Base64 format.
--   
--   This will not tell you whether or not this is a correct Base64
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>ShortText</a> value, use
--   <a>isBase64</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3Vu"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "U3V="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64 "%"
--   False
--   </pre>
isValidBase64 :: ShortText -> Bool


-- | This module contains <a>ShortText</a>-valued combinators implementing
--   the RFC 4648 specification for the Base64url encoding format. This
--   includes strictly padded/unpadded and lenient decoding variants, and
--   external + internal validations for canonicity.
module Data.Text.Short.Encoding.Base64.URL

-- | Encode a <a>ShortText</a> value in Base64url with padding.
--   
--   See: <a>RFC-4648 section 5</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64 "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4="
--   </pre>
encodeBase64 :: ShortText -> ShortText

-- | Encode a <a>ShortText</a> value in Base64url without padding. Note
--   that for Base64url, padding is optional. If you call this function,
--   you will simply be encoding as Base64url and stripping padding chars
--   from the output.
--   
--   See: <a>RFC-4648 section 3.2</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; encodeBase64Unpadded "&lt;&lt;?&gt;&gt;"
--   "PDw_Pj4"
--   </pre>
encodeBase64Unpadded :: ShortText -> ShortText

-- | Decode a padded Base64url-encoded <a>ShortText</a> value. If its
--   length is not a multiple of 4, then padding chars will be added to
--   fill out the input to a multiple of 4 for safe decoding as base64url
--   encodings are optionally padded.
--   
--   For a decoder that fails on unpadded input, use
--   <a>decodeBase64Unpadded</a>.
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <a>decodeBase64With</a> and pass in a custom decode
--   function.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64 "PDw-Pg"
--   Right "&lt;&lt;&gt;&gt;"
--   </pre>
decodeBase64 :: ShortText -> Either Text ShortText

-- | Attempt to decode a <a>ShortByteString</a> value as Base64url,
--   converting from <tt>ByteString</tt> to <a>ShortText</a> according to
--   some encoding function. In practice, This is something like
--   <tt>decodeUtf8'</tt>, which may produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64With</a> <a>decodeUtf8'</a>
--     :: <a>ShortByteString</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <a>ShortText</a>
--   </pre>
decodeBase64With :: (ShortByteString -> Either err ShortText) -> ShortByteString -> Either (Base64Error err) ShortText

-- | Decode an unpadded Base64url encoded <a>ShortText</a> value.
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <a>decodeBase64UnpaddedWith</a> and pass in a custom
--   decode function.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4"
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Unpadded "PDw_Pj4="
--   Left "Base64-encoded bytestring has invalid padding"
--   </pre>
decodeBase64Unpadded :: ShortText -> Either Text ShortText

-- | Attempt to decode an unpadded <a>ShortByteString</a> value as
--   Base64url, converting from <a>ShortByteString</a> to <a>ShortText</a>
--   according to some encoding function. In practice, This is something
--   like <tt>decodeUtf8'</tt>, which may produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64UnpaddedWith</a> <a>decodeUtf8'</a>
--     :: <a>ShortByteString</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <a>ShortText</a>
--   </pre>
decodeBase64UnpaddedWith :: (ShortByteString -> Either err ShortText) -> ShortByteString -> Either (Base64Error err) ShortText

-- | Decode an padded Base64url encoded <a>ShortText</a> value
--   
--   <i>Note:</i> This function makes sure that decoding is total by
--   deferring to <a>decodeLatin1</a>. This will always round trip for any
--   valid Base64-encoded text value, but it may not round trip for bad
--   inputs. The onus is on the caller to make sure inputs are valid. If
--   unsure, defer to <a>decodeBase64PaddedWith</a> and pass in a custom
--   decode function.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4="
--   Right "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Padded "PDw_Pj4"
--   Left "Base64-encoded bytestring requires padding"
--   </pre>
decodeBase64Padded :: ShortText -> Either Text ShortText

-- | Attempt to decode a padded <a>ShortByteString</a> value as Base64url,
--   converting from <tt>ByteString</tt> to <a>ShortText</a> according to
--   some encoding function. In practice, This is something like
--   <tt>decodeUtf8'</tt>, which may produce an error.
--   
--   See: <a>RFC-4648 section 4</a>
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   <a>decodeBase64With</a> <a>decodeUtf8'</a>
--     :: <a>ShortByteString</a> -&gt; <a>Either</a> (<a>Base64Error</a> <tt>UnicodeException</tt>) <a>ShortText</a>
--   </pre>
decodeBase64PaddedWith :: (ShortByteString -> Either err ShortText) -> ShortByteString -> Either (Base64Error err) ShortText

-- | Leniently decode an unpadded Base64url-encoded <a>ShortText</a>. This
--   function will not generate parse errors. If input data contains
--   padding chars, then the input will be parsed up until the first pad
--   character.
--   
--   <b>Note:</b> This is not RFC 4648-compliant.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_Pj4="
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decodeBase64Lenient "PDw_%%%$}Pj4"
--   "&lt;&lt;?&gt;&gt;"
--   </pre>
decodeBase64Lenient :: ShortText -> ShortText

-- | Tell whether a <a>ShortText</a> value is Base64url-encoded.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj4"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isBase64Url "PDw_Pj"
--   False
--   </pre>
isBase64Url :: ShortText -> Bool

-- | Tell whether a <a>ShortText</a> value is a valid Base64url format.
--   
--   This will not tell you whether or not this is a correct Base64url
--   representation, only that it conforms to the correct shape. To check
--   whether it is a true Base64 encoded <a>ShortText</a> value, use
--   <a>isBase64Url</a>.
--   
--   <h3><b>Examples</b>:</h3>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj4="
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "PDw_Pj"
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isValidBase64Url "%"
--   False
--   </pre>
isValidBase64Url :: ShortText -> Bool
