base-encoding-0.3.0.0: RFC4648 Binary-to-text encodings (e.g. base64)
Safe HaskellTrustworthy
LanguageHaskell2010

Codec.Base64Url.Unpadded

Description

This module provides access to the unpadded "base64url" binary-to-text encoding as defined by RFC 4648. See also Codec.Base64Url for the padded encoding variant.

This module is intended to be imported qualified, e.g.

import qualified Codec.Base64Url.Unpadded as B64

If you want to explictly specify which Encode and Decode typeclass instance is used, you can use plain Haskell2010 type-signature annotations, e.g.

>>> (B64.encode :: ByteString -> Text) "\x00\x00"
"AAA"
>>> (B64.decode :: Text -> Either String ShortByteString) "NDoyMA"
Right "4:20"

Alternatively, starting with GHC 8.0.1, you can also use the TypeApplications language extension:

>>> B64.encode @ShortByteString @Text "\xFF\239"
"_-8"
>>> B64.decode @Text @ShortByteString "_-8"
Right "\255\239"

Since: 0.2.0.0

Synopsis

Documentation

class Encode bin txt where Source #

Typeclass representing types for which a binary-to-text unpadded base64url encoding is defined

Since: 0.2.0.0

Methods

encode :: bin -> txt Source #

Encode binary data using unpadded base64url text encoding

Since: 0.2.0.0

Instances

Instances details
Encode ShortByteString ShortByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ShortByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ShortByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ShortByteString Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ShortByteString Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ShortByteString Text Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ShortByteString Text Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString ShortByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString Text Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString Text Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString ShortByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString Text Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode ByteString Text Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode Builder ShortByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode Builder ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode Builder ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode Builder Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode Builder Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Encode Builder Text Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Methods

encode :: Builder -> Text Source #

Encode Builder Text Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Methods

encode :: Builder -> Text Source #

class Decode txt bin where Source #

Typeclass representing types for which a text-to-binary unpadded base64url decoding is defined

Since: 0.2.0.0

Methods

decode :: txt -> Either String bin Source #

Decode binary data encoded textually as unpadded base64url

Since: 0.2.0.0

Instances

Instances details
Decode ShortByteString ShortByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode ShortByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode ShortByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode ShortByteString Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode ByteString ShortByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode ByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode ByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode ByteString Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode ByteString ShortByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode ByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode ByteString ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode ByteString Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Builder ShortByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Builder ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Builder ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Builder Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Builder ShortByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Builder ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Builder ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Builder Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Text ShortByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Text ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Text ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Text Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Text ShortByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Text ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Text ByteString Source # 
Instance details

Defined in Codec.Base64Url.Unpadded

Decode Text Builder Source # 
Instance details

Defined in Codec.Base64Url.Unpadded