| Copyright | (c) 2019 Emily Pillmore |
|---|---|
| License | BSD-style |
| Maintainer | Emily Pillmore <emilypi@cohomolo.gy> |
| Stability | Experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Text.Encoding.Base64.Lens
Description
This module contains Prisms Base64-encoding and
decoding Text values.
Synopsis
- _Base64 :: Prism' Text Text
- _Base64Url :: Prism' Text Text
- _Base64Unpadded :: Prism' Text Text
- _Base64UrlUnpadded :: Prism' Text Text
- _Base64Lenient :: Iso' Text Text
- _Base64UrlLenient :: Iso' Text Text
- pattern Base64 :: Text -> Text
- pattern Base64Url :: Text -> Text
- pattern Base64Unpadded :: Text -> Text
- pattern Base64UrlUnpadded :: Text -> Text
- pattern Base64Lenient :: Text -> Text
- pattern Base64UrlLenient :: Text -> Text
Prisms
_Base64 :: Prism' Text Text Source #
A Prism into the Base64 encoding of a Text value.
>>>_Base64 # "Sun""U3Vu"
>>>"U3Vu" ^? _Base64Just "Sun"
_Base64Url :: Prism' Text Text Source #
A Prism into the Base64-url encoding of a Text value.
>>>_Base64Url # "Sun""U3Vu"
>>>"PDw_Pz8-Pg==" ^? _Base64UrlJust "<<???>>"
_Base64Unpadded :: Prism' Text Text Source #
A Prism into the unpadded Base64 encoding of a
Text value.
Please note that unpadded variants should only be used when assumptions about the data can be made. In particular, if the length of the input is divisible by 3, then this is a safe function to call.
>>>_Base64Unpadded # "Sun""U3Vu"
>>>"U3Vu" ^? _Base64UnpaddedJust "Sun"
_Base64UrlUnpadded :: Prism' Text Text Source #
A Prism into the Base64-url encoding of a Text value.
Please note that unpadded variants should only be used when assumptions about the data can be made. In particular, if the length of the input is divisible by 3, then this is a safe function to call.
>>>_Base64UrlUnpadded # "<<??>>""PDw_Pz4-"
>>>"PDw_Pz4-" ^? _Base64UrlUnpaddedJust "<<??>>"
_Base64Lenient :: Iso' Text Text Source #
An Iso' into the Base64 encoding of a Text value
using lenient decoding.
_Note:_ This is not a lawful Iso.
>>>"Sun" ^. _Base64Lenient"U3Vu"
>>>"U3Vu" ^. from _Base64Lenient"Sun"
_Base64UrlLenient :: Iso' Text Text Source #
An Iso' into the Base64url encoding of a Text value
using lenient decoding.
_Note:_ This is not a lawful Iso.
>>>"<<??>>" ^. _Base64UrlLenient"PDw_Pz4-"
>>>"PDw_Pz4-" ^. from _Base64UrlLenient"<<??>>"
Patterns
pattern Base64 :: Text -> Text Source #
Unidirectional pattern synonym for base64-encoded Text values.
pattern Base64Url :: Text -> Text Source #
Unidirectional pattern synonym for base64url-encoded Text values.
pattern Base64Unpadded :: Text -> Text Source #
Unidirectional pattern synonym for unpadded base64-encoded Text values.
pattern Base64UrlUnpadded :: Text -> Text Source #
Unidirectional pattern synonym for unpadded base64url-encoded Text values.