| 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.ByteString.Base64.Lens
Description
This module contains Prisms Base64-encoding and
decoding ByteString values.
Synopsis
- _Base64 :: Prism' ByteString ByteString
- _Base64Url :: Prism' ByteString ByteString
- _Base64Unpadded :: Prism' ByteString ByteString
- _Base64UrlUnpadded :: Prism' ByteString ByteString
- pattern Base64 :: ByteString -> ByteString
- pattern Base64Url :: ByteString -> ByteString
- pattern Base64Unpadded :: ByteString -> ByteString
- pattern Base64UrlUnpadded :: ByteString -> ByteString
Prisms
_Base64 :: Prism' ByteString ByteString Source #
A Prism into the Base64 encoding of a ByteString value
>>>_Base64 # "Sun""UV3u"
>>>"UV3u" ^? _Base64Just "Sun"
_Base64Url :: Prism' ByteString ByteString Source #
A Prism into the Base64-url encoding of a ByteString value
>>>_Base64Url # "Sun""UV3u"
>>>"PDw_Pz8-Pg==" ^? _Base64UrlJust "<<???>>"
_Base64Unpadded :: Prism' ByteString ByteString Source #
A Prism into the unpadded Base64 encoding of a
ByteString 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""UV3u"
>>>"UV3u" ^? _Base64UnpaddedJust "Sun"
_Base64UrlUnpadded :: Prism' ByteString ByteString Source #
A Prism into the Base64-url encoding of a ByteString 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 "<<??>>"
Patterns
pattern Base64 :: ByteString -> ByteString Source #
Unidirectional pattern synonym for base64-encoded ByteString values.
pattern Base64Url :: ByteString -> ByteString Source #
Unidirectional pattern synonym for base64url-encoded ByteString values.
pattern Base64Unpadded :: ByteString -> ByteString Source #
Unidirectional pattern synonym for unpadded base64-encoded ByteString values.
pattern Base64UrlUnpadded :: ByteString -> ByteString Source #
Unidirectional pattern synonym for unpadded base64url-encoded ByteString values.