Next: HTTP cookie handling, Previous: RFC822 message parsing, Up: Library modules - Utilities [Contents][Index]
rfc.base64
- Base64 encoding/decodingThis module defines a few functions to encode/decode Base64 format, defined in RFC 2045 (RFC2045), section 6.3 and RFC 4648 (RFC4648)
{rfc.base64} Reads byte stream from the current input port, encodes it in Base64 format and writes the result character stream to the current output port. The conversion ends when it reads EOF from the current input port.
Newline characters can be inserted to keep the maximum line width to
the value given to the line-width keyword argument. The default
value of line-width is 76, as specified in RFC2045. You can give
#f
or zero to line-width to suppress line splitting.
If a true value is given to url-safe,
the input bytes will be encoded with an
alternative encoding table, which substitutes +
instead of
-
and /
instead of _
. The result will contain
filename and url safe characters only. Default value of url-safe
is false.
{rfc.base64} Converts contents of string to Base64 encoded format. Input string can be either complete or incomplete string; it is always interpreted as a byte sequence.
{rfc.base64}
Reads character stream from the current input port, decodes it from Base64
format and writes the result byte stream to the current output port.
The conversion ends when it reads EOF or the termination character
(=
). The characters which does not in legal Base64 encoded character
set are silently ignored.
{rfc.base64}
Decodes a Base64 encoded string string and returns
the result as a string.
The conversion terminates at the end of string or
the termination character (=
).
The characters which does not in legal Base64 encoded character
set are silently ignored.
Next: HTTP cookie handling, Previous: RFC822 message parsing, Up: Library modules - Utilities [Contents][Index]