-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Fast RFC 4648-compliant Base64 encoding -- -- RFC 4648-compliant padded and unpadded base64 and base64url encoding -- and decoding. This library provides performant encoding and decoding -- primitives, as well as support for textual values. @package base64 @version 0.4.2 -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64 encoding including unpadded and lenient -- variants module Data.ByteString.Base64 -- | Encode a ByteString value as Base64 Text with padding. -- -- See: RFC-4648 section 4 encodeBase64 :: ByteString -> Text -- | Encode a ByteString value as a Base64 ByteString value -- with padding. -- -- See: RFC-4648 section 4 encodeBase64' :: ByteString -> ByteString -- | Decode a padded Base64-encoded ByteString value. -- -- See: RFC-4648 section 4 decodeBase64 :: ByteString -> Either Text ByteString -- | Leniently decode an unpadded Base64-encoded ByteString 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: ByteString -> ByteString -- | Tell whether a ByteString value is base64 encoded. isBase64 :: ByteString -> Bool -- | Tell whether a ByteString 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 ByteString value, use -- isBase64. isValidBase64 :: ByteString -> Bool -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64-URL encoding including unpadded and -- lenient variants module Data.ByteString.Base64.URL -- | Encode a ByteString value as a Base64url Text value with -- padding. -- -- See: RFC-4648 section 5 encodeBase64 :: ByteString -> Text -- | Encode a ByteString as a Base64url ByteString value with -- padding. -- -- See: RFC-4648 section 5 encodeBase64' :: ByteString -> ByteString -- | Decode a padded Base64url encoded ByteString 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 -- decodeBase64Unpadded. -- -- See: RFC-4648 section 4 decodeBase64 :: ByteString -> Either Text ByteString -- | Encode a ByteString value as Base64url Text 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: RFC-4648 section 3.2 encodeBase64Unpadded :: ByteString -> Text -- | Encode a ByteString 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: RFC-4648 section 3.2 encodeBase64Unpadded' :: ByteString -> ByteString -- | Decode an unpadded Base64url-encoded ByteString 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 decodeBase64. -- -- See: RFC-4648 section 4 decodeBase64Unpadded :: ByteString -> Either Text ByteString -- | Decode a padded Base64url-encoded ByteString 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 decodeBase64. -- -- See: RFC-4648 section 4 decodeBase64Padded :: ByteString -> Either Text ByteString -- | Leniently decode an unpadded Base64url-encoded ByteString. 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: ByteString -> ByteString -- | Tell whether a ByteString is Base64url-encoded. isBase64Url :: ByteString -> Bool -- | Tell whether a ByteString 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 ByteString value, use -- isBase64Url. isValidBase64Url :: ByteString -> Bool -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64 encoding including unpadded and lenient -- variants module Data.ByteString.Lazy.Base64 -- | Encode a ByteString value as Base64 Text with padding. -- -- See: RFC-4648 section 4 encodeBase64 :: ByteString -> Text -- | Encode a ByteString value as a Base64 ByteString value -- with padding. -- -- See: RFC-4648 section 4 encodeBase64' :: ByteString -> ByteString -- | Decode a padded Base64-encoded ByteString value. -- -- See: RFC-4648 section 4 decodeBase64 :: ByteString -> Either Text ByteString -- | Leniently decode an unpadded Base64-encoded ByteString 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: ByteString -> ByteString -- | Tell whether a ByteString value is base64 encoded. isBase64 :: ByteString -> Bool -- | Tell whether a ByteString 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 ByteString value, use -- isBase64. isValidBase64 :: ByteString -> Bool -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64 encoding including unpadded and lenient -- variants module Data.ByteString.Lazy.Base64.URL -- | Encode a ByteString value as a Base64url Text value -- with padding. -- -- See: RFC-4648 section 5 encodeBase64 :: ByteString -> Text -- | Encode a ByteString as a Base64url ByteString value with -- padding. -- -- See: RFC-4648 section 5 encodeBase64' :: ByteString -> ByteString -- | Encode a ByteString value as Base64url Text 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: RFC-4648 section 3.2 encodeBase64Unpadded :: ByteString -> Text -- | Encode a ByteString 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: RFC-4648 section 3.2 encodeBase64Unpadded' :: ByteString -> ByteString -- | Decode a padded Base64url encoded ByteString 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 -- decodeBase64Unpadded. -- -- See: RFC-4648 section 4 decodeBase64 :: ByteString -> Either Text ByteString -- | Decode a padded Base64url-encoded ByteString 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 decodeBase64. -- -- See: RFC-4648 section 4 decodeBase64Padded :: ByteString -> Either Text ByteString -- | Decode an unpadded Base64url-encoded ByteString 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 decodeBase64. -- -- See: RFC-4648 section 4 decodeBase64Unpadded :: ByteString -> Either Text ByteString -- | Leniently decode an unpadded Base64url-encoded ByteString. 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: ByteString -> ByteString -- | Tell whether a ByteString is Base64url-encoded. isBase64Url :: ByteString -> Bool -- | Tell whether a ByteString 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 ByteString value, use -- isBase64Url. isValidBase64Url :: ByteString -> Bool -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64 encoding including unpadded and lenient -- variants module Data.ByteString.Short.Base64 -- | Encode a ShortByteString value as Base64 Text with -- padding. -- -- See: RFC-4648 section 4 encodeBase64 :: ShortByteString -> ShortText -- | Encode a ShortByteString value as a Base64 -- ShortByteString value with padding. -- -- See: RFC-4648 section 4 encodeBase64' :: ShortByteString -> ShortByteString -- | Decode a padded Base64-encoded ShortByteString value. -- -- See: RFC-4648 section 4 decodeBase64 :: ShortByteString -> Either Text ShortByteString -- | Leniently decode an unpadded Base64-encoded ShortByteString -- 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: ShortByteString -> ShortByteString -- | Tell whether a ShortByteString value is base64 encoded. isBase64 :: ShortByteString -> Bool -- | Tell whether a ShortByteString 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 ShortByteString value, use -- isBase64. isValidBase64 :: ShortByteString -> Bool -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64url encoding including unpadded and -- lenient variants module Data.ByteString.Short.Base64.URL -- | Encode a ShortByteString value as a Base64url Text value -- with padding. -- -- See: RFC-4648 section 5 encodeBase64 :: ShortByteString -> ShortText -- | Encode a ShortByteString value as Base64url Text 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: RFC-4648 section 3.2 encodeBase64Unpadded :: ShortByteString -> ShortText -- | Encode a ShortByteString as a Base64url ShortByteString -- value with padding. -- -- See: RFC-4648 section 5 encodeBase64' :: ShortByteString -> ShortByteString -- | Encode a ShortByteString 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: RFC-4648 section 3.2 encodeBase64Unpadded' :: ShortByteString -> ShortByteString -- | Decode a padded Base64url encoded ShortByteString 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 -- decodeBase64Unpadded. -- -- See: RFC-4648 section 4 decodeBase64 :: ShortByteString -> Either Text ShortByteString -- | Decode a padded Base64url-encoded ShortByteString 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 decodeBase64. -- -- See: RFC-4648 section 4 decodeBase64Padded :: ShortByteString -> Either Text ShortByteString -- | Decode an unpadded Base64url-encoded ShortByteString 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 decodeBase64. -- -- See: RFC-4648 section 4 decodeBase64Unpadded :: ShortByteString -> Either Text ShortByteString -- | Leniently decode an unpadded Base64url-encoded ShortByteString. -- 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: ShortByteString -> ShortByteString -- | Tell whether a ShortByteString is Base64url-encoded. isBase64Url :: ShortByteString -> Bool -- | Tell whether a ShortByteString 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 ShortByteString value, use -- isBase64Url. 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 Text 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.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) -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64 encoding including unpadded and lenient -- variants module Data.Text.Encoding.Base64 -- | Encode a Text value in Base64 with padding. -- -- See: RFC-4648 section 4 encodeBase64 :: Text -> Text -- | Decode a padded Base64-encoded Text value. -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64With and pass in a custom decode -- function. -- -- See: RFC-4648 section 4 decodeBase64 :: Text -> Either Text Text -- | Attempt to decode a Text value as Base64, converting from -- ByteString to Text according to some encoding function. -- In practice, This is something like decodeUtf8', which may -- produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: ByteString -> Either (Base64Error UnicodeException) Text
--   
decodeBase64With :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text -- | Leniently decode a Base64-encoded Text 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: Text -> Text -- | Tell whether a Text value is Base64-encoded. isBase64 :: Text -> Bool -- | Tell whether a Text 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 Text value, use -- isBase64. isValidBase64 :: Text -> Bool -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64-URL encoding including unpadded and -- lenient variants module Data.Text.Encoding.Base64.URL -- | Encode a Text value in Base64url with padding. -- -- See: RFC-4648 section 5 encodeBase64 :: Text -> Text -- | Decode a padded Base64url-encoded Text 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 -- decodeBase64Unpadded -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64With and pass in a custom decode -- function. -- -- See: RFC-4648 section 4 decodeBase64 :: Text -> Either Text Text -- | Attempt to decode a ByteString value as Base64url, converting -- from ByteString to Text according to some encoding -- function. In practice, This is something like decodeUtf8', -- which may produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: Text -> Either (Base64Error UnicodeException) Text
--   
decodeBase64With :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text -- | Encode a Text 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: RFC-4648 section 3.2 encodeBase64Unpadded :: Text -> Text -- | Decode an unpadded Base64url encoded Text value. -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64UnpaddedWith and pass in a custom -- decode function. -- -- See: RFC-4648 section 4 decodeBase64Unpadded :: Text -> Either Text Text -- | Attempt to decode an unpadded ByteString value as Base64url, -- converting from ByteString to Text according to some -- encoding function. In practice, This is something like -- decodeUtf8', which may produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: ByteString -> Either (Base64Error UnicodeException) Text
--   
decodeBase64UnpaddedWith :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text -- | Decode an padded Base64url encoded Text value -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64PaddedWith and pass in a custom -- decode function. -- -- See: RFC-4648 section 4 decodeBase64Padded :: Text -> Either Text Text -- | Attempt to decode a padded ByteString value as Base64url, -- converting from ByteString to Text according to some -- encoding function. In practice, This is something like -- decodeUtf8', which may produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: ByteString -> Either (Base64Error UnicodeException) Text
--   
decodeBase64PaddedWith :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text -- | Leniently decode an unpadded Base64url-encoded Text. 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: Text -> Text -- | Tell whether a Text value is Base64url-encoded. isBase64Url :: Text -> Bool -- | Tell whether a Text 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 Text value, use -- isBase64Url. isValidBase64Url :: Text -> Bool -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64 encoding including unpadded and lenient -- variants module Data.Text.Lazy.Encoding.Base64 -- | Encode a Text value in Base64 with padding. -- -- See: RFC-4648 section 4 encodeBase64 :: Text -> Text -- | Decode a padded Base64-encoded Text value -- -- See: RFC-4648 section 4 -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64With and pass in a custom decode -- function. decodeBase64 :: Text -> Either Text Text -- | Attempt to decode a ByteString value as Base64, converting from -- ByteString to Text according to some encoding function. -- In practice, This is something like decodeUtf8', which may -- produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: ByteString -> Either (Base64Error UnicodeException) Text
--   
decodeBase64With :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text -- | Leniently decode a Base64-encoded Text 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: Text -> Text -- | Tell whether a Text value is Base64-encoded. isBase64 :: Text -> Bool -- | Tell whether a Text 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 Text value, use -- isBase64. isValidBase64 :: Text -> Bool -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64-URL encoding including unpadded and -- lenient variants module Data.Text.Lazy.Encoding.Base64.URL -- | Encode a Text value in Base64url with padding. -- -- See: RFC-4648 section 5 encodeBase64 :: Text -> Text -- | Decode a padded Base64url-encoded Text 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 -- decodeBase64Unpadded. -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64With and pass in a custom decode -- function. -- -- See: RFC-4648 section 4 decodeBase64 :: Text -> Either Text Text -- | Attempt to decode a lazy ByteString value as Base64url, -- converting from ByteString to Text according to some -- encoding function. In practice, This is something like -- decodeUtf8', which may produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: ByteString -> Either (Base64Error UnicodeException) Text
--   
decodeBase64With :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text -- | Encode a Text 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: RFC-4648 section 3.2 encodeBase64Unpadded :: Text -> Text -- | Decode an unpadded Base64url encoded Text value. -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64WUnpaddedWith and pass in a -- custom decode function. -- -- See: RFC-4648 section 4 decodeBase64Unpadded :: Text -> Either Text Text -- | Attempt to decode an unpadded lazy ByteString value as -- Base64url, converting from ByteString to Text according -- to some encoding function. In practice, This is something like -- decodeUtf8', which may produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: ByteString -> Either (Base64Error UnicodeException) Text
--   
decodeBase64UnpaddedWith :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text -- | Decode an padded Base64url encoded Text value -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64PaddedWith and pass in a custom -- decode function. -- -- See: RFC-4648 section 4 decodeBase64Padded :: Text -> Either Text Text -- | Attempt to decode a padded lazy ByteString value as Base64url, -- converting from ByteString to Text according to some -- encoding function. In practice, This is something like -- decodeUtf8', which may produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: ByteString -> Either (Base64Error UnicodeException) Text
--   
decodeBase64PaddedWith :: (ByteString -> Either err Text) -> ByteString -> Either (Base64Error err) Text -- | Leniently decode an unpadded Base64url-encoded Text. 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: Text -> Text -- | Tell whether a Text value is Base64url-encoded. isBase64Url :: Text -> Bool -- | Tell whether a Text 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 Text value, use -- isBase64Url. isValidBase64Url :: Text -> Bool -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64 encoding including unpadded and lenient -- variants module Data.Text.Short.Encoding.Base64 -- | Encode a ShortText value in Base64 with padding. -- -- See: RFC-4648 section 4 encodeBase64 :: ShortText -> ShortText -- | Decode a padded Base64-encoded ShortText value -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64With and pass in a custom decode -- function. -- -- See: RFC-4648 section 4 decodeBase64 :: ShortText -> Either Text ShortText -- | Attempt to decode a ShortByteString value as Base64, converting -- from ByteString to ShortText according to some -- encoding function. In practice, This is something like -- decodeUtf8', which may produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: ShortByteString -> Either (Base64Error UnicodeException) ShortText
--   
decodeBase64With :: (ShortByteString -> Either err ShortText) -> ShortByteString -> Either (Base64Error err) ShortText -- | Leniently decode a Base64-encoded ShortText 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: ShortText -> ShortText -- | Tell whether a ShortText value is Base64-encoded. isBase64 :: ShortText -> Bool -- | Tell whether a ShortText 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 ShortText value, use -- isBase64. isValidBase64 :: ShortText -> Bool -- | This module contains the combinators implementing the RFC 4648 -- specification for the Base64-URL encoding including unpadded and -- lenient variants module Data.Text.Short.Encoding.Base64.URL -- | Encode a ShortText value in Base64url with padding. -- -- See: RFC-4648 section 5 encodeBase64 :: ShortText -> ShortText -- | Decode a padded Base64url-encoded ShortText 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 -- decodeBase64Unpadded. -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64With and pass in a custom decode -- function. -- -- See: RFC-4648 section 4 decodeBase64 :: ShortText -> Either Text ShortText -- | Attempt to decode a ShortByteString value as Base64url, -- converting from ByteString to ShortText according to -- some encoding function. In practice, This is something like -- decodeUtf8', which may produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: ShortByteString -> Either (Base64Error UnicodeException) ShortText
--   
decodeBase64With :: (ShortByteString -> Either err ShortText) -> ShortByteString -> Either (Base64Error err) ShortText -- | Encode a ShortText 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: RFC-4648 section 3.2 encodeBase64Unpadded :: ShortText -> ShortText -- | Decode an unpadded Base64url encoded ShortText value. -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64UnpaddedWith and pass in a custom -- decode function. -- -- See: RFC-4648 section 4 decodeBase64Unpadded :: ShortText -> Either Text ShortText -- | Attempt to decode an unpadded ShortByteString value as -- Base64url, converting from ShortByteString to ShortText -- according to some encoding function. In practice, This is something -- like decodeUtf8', which may produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: ShortByteString -> Either (Base64Error UnicodeException) ShortText
--   
decodeBase64UnpaddedWith :: (ShortByteString -> Either err ShortText) -> ShortByteString -> Either (Base64Error err) ShortText -- | Decode an padded Base64url encoded ShortText value -- -- Note: This function makes sure that decoding is total by -- deferring to decodeLatin1. 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 decodeBase64PaddedWith and pass in a custom -- decode function. -- -- See: RFC-4648 section 4 decodeBase64Padded :: ShortText -> Either Text ShortText -- | Attempt to decode a padded ShortByteString value as Base64url, -- converting from ByteString to ShortText according to -- some encoding function. In practice, This is something like -- decodeUtf8', which may produce an error. -- -- See: RFC-4648 section 4 -- -- Example: -- --
--   decodeBase64With decodeUtf8'
--     :: ShortByteString -> Either (Base64Error UnicodeException) ShortText
--   
decodeBase64PaddedWith :: (ShortByteString -> Either err ShortText) -> ShortByteString -> Either (Base64Error err) ShortText -- | Leniently decode an unpadded Base64url-encoded ShortText. 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. -- -- Note: This is not RFC 4648-compliant. decodeBase64Lenient :: ShortText -> ShortText -- | Tell whether a ShortText value is Base64url-encoded. isBase64Url :: ShortText -> Bool -- | Tell whether a ShortText 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 ShortText value, use -- isBase64Url. isValidBase64Url :: ShortText -> Bool