serokell-util-0.1.2.4: General-purpose functions by Serokell

Safe HaskellNone
LanguageHaskell2010

Serokell.Util.Base64

Description

Base64 encoding/decoding.

Synopsis

Documentation

encode :: ByteString -> Text Source #

Apply base64 encoding to strict ByteString.

decode :: Text -> Either Text ByteString Source #

Decode base64-encoded ByteString.

encodeUrl :: ByteString -> Text Source #

Apply base64url encoding to strict ByteString.

decodeUrl :: Text -> Either Text ByteString Source #

Decode base64url-encoded ByteString.

formatBase64 :: ByteString -> Builder Source #

Construct Builder from bytestring formatting it in Base64.

base64F :: Format r (ByteString -> r) Source #

Format which uses Base64 to print bytestring.

newtype JsonByteString Source #

Wrapper on top of ByteString with JSON serialization (in base64 encoding).