Copyright | (c) Dong Han 2017-2018 |
---|---|
License | BSD |
Maintainer | winterland1989@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module provides base64 encoding & decoding tools, as well as Base64Bytes
newtype with base64 textual instances.
Synopsis
- newtype Base64Bytes = Base64Bytes {}
- base64Encode :: Bytes -> Bytes
- base64EncodeLength :: Int -> Int
- base64EncodeText :: Bytes -> Text
- base64EncodeBuilder :: Bytes -> Builder ()
- base64Decode :: Bytes -> Maybe Bytes
- base64Decode' :: HasCallStack => Bytes -> Bytes
- base64DecodeLength :: Int -> Int
- data Base64DecodeException
- hs_base64_encode :: MBA# Word8 -> Int -> BA# Word8 -> Int -> Int -> IO ()
- hs_base64_decode :: MBA# Word8 -> BA# Word8 -> Int -> Int -> IO Int
The Base64Bytes type
newtype Base64Bytes Source #
New type wrapper for Bytes
with base64 encoding Show/JSON instances.
Instances
Encoding & Decoding functions
base64EncodeLength :: Int -> Int Source #
Return the encoded length of a given input length, always a multipler of 4.
base64EncodeText :: Bytes -> Text Source #
Text version of base64Encode
.
base64EncodeBuilder :: Bytes -> Builder () Source #
Builder
version of base64Encode
.
base64Decode :: Bytes -> Maybe Bytes Source #
Decode a base64 encoding string, return Nothing on illegal bytes or incomplete input.
base64Decode' :: HasCallStack => Bytes -> Bytes Source #
Decode a base64 encoding string, throw Base64DecodeException
on error.
base64DecodeLength :: Int -> Int Source #
Return the upper bound of decoded length of a given input length , return -1 if illegal(not a multipler of 4).
data Base64DecodeException Source #
Exception during base64 decoding.
Instances
Show Base64DecodeException Source # | |
Defined in Z.Data.Vector.Base64 showsPrec :: Int -> Base64DecodeException -> ShowS # show :: Base64DecodeException -> String # showList :: [Base64DecodeException] -> ShowS # | |
Exception Base64DecodeException Source # | |