Copyright | (c) 2019 Emily Pillmore |
---|---|
License | BSD-style |
Maintainer | Emily Pillmore <emilypi@cohomolo.gy> |
Stability | Experimental |
Portability | non-portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
This module contains Prism'
s for Base32-encoding and
decoding ByteString
values.
Synopsis
- _Base32 :: Prism' ByteString ByteString
- _Base32Unpadded :: Prism' ByteString ByteString
- _Base32Hex :: Prism' ByteString ByteString
- _Base32HexUnpadded :: Prism' ByteString ByteString
- pattern Base32 :: ByteString -> ByteString
- pattern Base32Unpadded :: ByteString -> ByteString
- pattern Base32Hex :: ByteString -> ByteString
- pattern Base32HexUnpadded :: ByteString -> ByteString
Prisms
_Base32 :: Prism' ByteString ByteString Source #
A Prism'
into the Base32 encoding of a ByteString
value
>>>
_Base32 # "Sun"
"KN2W4==="
>>>
"KN2W4===" ^? _Base32
Just "Sun"
_Base32Unpadded :: Prism' ByteString ByteString Source #
A Prism'
into the Base32 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.
>>>
_Base32Unpadded # "Sun"
"KN2W4"
>>>
"KN2W4" ^? _Base32Unpadded
Just "Sun"
_Base32Hex :: Prism' ByteString ByteString Source #
A Prism'
into the Base32hex encoding of a ByteString
value
>>>
_Base32Hex # "Sun"
"ADQMS==="
>>>
"ADQMS===" ^? _Base32Hex
Just "Sun"
_Base32HexUnpadded :: Prism' ByteString ByteString Source #
A Prism'
into the Base32hex 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.
>>>
_Base32HexUnpadded # "Sun"
"ADQMS"
>>>
"ADQMS" ^? _Base32HexUnpadded
Just "Sun"
Patterns
pattern Base32 :: ByteString -> ByteString Source #
Bidirectional pattern synonym for Base32-encoded ByteString
values.
pattern Base32Unpadded :: ByteString -> ByteString Source #
Bidirectional pattern synonym for unpadded Base32-encoded ByteString
values.
pattern Base32Hex :: ByteString -> ByteString Source #
Bidirectional pattern synonym for Base32hex-encoded ByteString
values.
pattern Base32HexUnpadded :: ByteString -> ByteString Source #
Bidirectional pattern synonym for unpadded Base32hex-encoded ByteString
values.