Namespace: joker.base64
v1.0Contents
Summary
Encodes and decodes strings with standard padded Base64 as specified by RFC 4648.
Index
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
(None.)
Functions, Macros, and Special Forms
-
decode-string
Function v1.0(decode-string s)Decodes standard padded Base64 string s and returns the decoded bytes as a
string.
The standard RFC 4648 alphabet is used. Carriage returns and line feeds in s
are ignored. Throws Error when s contains invalid Base64 data or malformed
padding.
The returned string may contain arbitrary bytes, not only printable text.
Example:
(joker.base64/decode-string "aGVsbG8=")
;; => "hello" -
encode-string
Function v1.0(encode-string s)Returns the standard padded Base64 encoding of string s.
s is encoded from its raw bytes using the RFC 4648 standard alphabet and = as
padding when needed.
Example:
(joker.base64/encode-string "hello")
;; => "aGVsbG8="