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