Data.ByteString.Base64.URL

base64-bytestring-1.2.1.0: Fast base64 encoding and decoding for ByteStrings

Copyright | (c) 2012 Deian Stefan
License | BSD-style
Maintainer | Emily Pillmore <emilypi@cohomolo.gy>, Herbert Valerio Riedel <hvr@gnu.org>, Mikhail Glushenkov <mikhail.glushenkov@gmail.com>
Stability | experimental
Portability | GHC
Safe Haskell | Trustworthy
Language | Haskell2010

Data.ByteString.Base64.URL

Description

Fast and efficient encoding and decoding of base64url-encoded strings.

Since: 0.1.1.0

Synopsis

- encode :: ByteString -> ByteString
- encodeUnpadded :: ByteString -> ByteString
- decode :: ByteString -> Either String ByteString
- decodePadded :: ByteString -> Either String ByteString
- decodeUnpadded :: ByteString -> Either String ByteString
- decodeLenient :: ByteString -> ByteString

# Documentation

encode :: ByteString -> ByteString #

Encode a string into base64url form. The result will always be a multiple of 4 bytes in length.

encodeUnpadded :: ByteString -> ByteString #

Encode a string into unpadded base64url form.

Since: 1.1.0.0

decode :: ByteString -> Either String ByteString #

Decode a base64url-encoded string applying padding if necessary. This function follows the specification in RFC 4648 and in RFC 7049 2.4

decodePadded :: ByteString -> Either String ByteString #

Decode a padded base64url-encoded string, failing if input is improperly padded. This function follows the specification in RFC 4648 and in RFC 7049 2.4

Since: 1.1.0.0

decodeUnpadded :: ByteString -> Either String ByteString #

Decode a unpadded base64url-encoded string, failing if input is padded. This function follows the specification in RFC 4648 and in RFC 7049 2.4

Since: 1.1.0.0

decodeLenient :: ByteString -> ByteString #

Decode a base64url-encoded string. This function is lenient in following the specification from RFC 4648, and will not generate parse errors no matter how poor its input.