base64url -package:base64
Prism for encoding / decoding base64url.
To encode,
review base64url. To decode,
preview base64url.
Works with any combinations of strict/lazy
ByteString.
Implemented as specified in RFC 4648
(
http://tools.ietf.org/html/rfc4648).
The difference compared to vanilla Base64 encoding is just in two
characters. In Base64 the characters
/+ are used, and in
Base64Url they are replaced by
_- respectively.
Please refer to
Codec.Binary.Base64 for the details of all
functions in this module.
Convert a bytestring to base64url (a variant of base64 which omits
/ and thus can be used in URLs):
>>> base64UrlF ("\0\50\63\80" :: BS.ByteString)
"ADI_UA=="
Transform a number of bytes pointed by src to, URL-safe
base64 binary representation in dst. The result will be
either padded or unpadded, depending on the boolean padded
argument.
The destination memory need to be of correct size, otherwise it will
lead to really bad things.
Transform string src to URL-safe base64 binary
representation. The result will be either padded or unpadded,
depending on the boolean padded argument.