Copyright | (c) 2019-2021 Emily Pillmore |
---|---|
License | BSD-style |
Maintainer | Emily Pillmore <emilypi@cohomolo.gy> |
Stability | Experimental |
Portability | non-portable |
Safe Haskell | Safe |
Language | Haskell2010 |
This module contains Prism'
s and Iso'
s for Base64-encoding and
decoding ShortByteString
values.
Synopsis
- _Base64 :: Prism' ShortByteString ShortByteString
- _Base64Url :: Prism' ShortByteString ShortByteString
- _Base64UrlUnpadded :: Prism' ShortByteString ShortByteString
- _Base64Lenient :: Iso' ShortByteString ShortByteString
- _Base64UrlLenient :: Iso' ShortByteString ShortByteString
- pattern Base64 :: ShortByteString -> ShortByteString
- pattern Base64Url :: ShortByteString -> ShortByteString
- pattern Base64UrlUnpadded :: ShortByteString -> ShortByteString
- pattern Base64Lenient :: ShortByteString -> ShortByteString
- pattern Base64UrlLenient :: ShortByteString -> ShortByteString
Prisms
_Base64 :: Prism' ShortByteString ShortByteString Source #
A Prism'
into the Base64 encoding of a ShortByteString
value
>>>
_Base64 # "Sun"
"U3Vu"
>>>
"U3Vu" ^? _Base64
Just "Sun"
_Base64Url :: Prism' ShortByteString ShortByteString Source #
A Prism'
into the Base64url encoding of a ShortByteString
value
>>>
_Base64Url # "Sun"
"U3Vu"
>>>
"PDw_Pz8-Pg==" ^? _Base64Url
Just "<<???>>"
_Base64UrlUnpadded :: Prism' ShortByteString ShortByteString Source #
A Prism'
into the Base64url encoding of a ShortByteString
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-" ^? _Base64UrlUnpadded
Just "<<??>>"
_Base64Lenient :: Iso' ShortByteString ShortByteString Source #
An Iso'
into the Base64 encoding of a ShortByteString
value
using lenient decoding.
_Note:_ This is not a lawful Iso
. Please take care!
>>>
_Base64Lenient # "Sun"
"U3Vu"
>>>
"U3Vu" ^. _Base64Lenient
"Sun"
_Base64UrlLenient :: Iso' ShortByteString ShortByteString Source #
An Iso'
into the Base64url encoding of a ShortByteString
value
using lenient decoding.
_Note:_ This is not a lawful Iso
. Please take care!
>>>
_Base64UrlLenient # "<<??>>"
"PDw_Pz4-"
>>>
"PDw_Pz4-" ^. _Base64UrlLenient
"<<??>>"
Patterns
pattern Base64 :: ShortByteString -> ShortByteString Source #
Bidirectional pattern synonym for base64-encoded ShortByteString
values.
pattern Base64Url :: ShortByteString -> ShortByteString Source #
Bidirectional pattern synonym for base64url-encoded ShortByteString
values.
pattern Base64UrlUnpadded :: ShortByteString -> ShortByteString Source #
Bidirectional pattern synonym for unpadded base64url-encoded ShortByteString
values.
pattern Base64Lenient :: ShortByteString -> ShortByteString Source #
Bidirectional pattern synonym for leniently Base64-encoded ShortByteString
values
pattern Base64UrlLenient :: ShortByteString -> ShortByteString Source #
Bidirectional pattern synonym for leniently Base64-encoded ShortByteString
values