[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.19 rfc.base64 - Base64 encoding/decoding

Module: rfc.base64

This module defines a few functions to encode/decode Base64 format, defined in RFC 2045 (RFC2045), section 6.3 and RFC3548 (RFC3548)

Function: base64-encode :key line-width

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.

Function: base64-encode-string string :key line-width

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.

Function: base64-decode

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.

Function: base64-decode-string string

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Shiro Kawai on May 28, 2012 using texi2html 1.82.