Collection of methods to handle rfc3548 Base64 encoding.
Class Base64
| Methods | |
| decmb | Decodes a previously encoded binary data. |
| decode | Decodes a previously encoded text data. |
| encode | Transforms an input string or MemBuf into a Base64 encoded string. |
Decodes a previously encoded binary data.
Base64.decmb( data )
| data | The data to be decoded. | ||
| Return | The origianl data, as a binary sequence of bytes. | ||
| Raise |
|
This static method decodes the contents of the incoming data as a base64 encoded string into a binary buffer.
Decodes a previously encoded text data.
Base64.decode( data )
| data | The data to be decoded. | ||
| Return | The original string (as an international text). | ||
| Raise |
|
This static method decodes the contents of the incoming data as a base64 encoded string into a Falcon text-oriented String.
The rfc3548 doesn't define the encoding of the input data, as base64 is a method to encode generic binary data and send them across the Internet. However, it's common practice to encode textual contents as utf-8 strings and then apply the base64 encoding.
So, this method supposes that the data, to be transformed in a string, is actually an utf-8 representation of a text. If this is not desired, use the Base64.decmb method.
Transforms an input string or MemBuf into a Base64 encoded string.
Base64.encode( data )
| data | The data to be encoded. |
| Return | The encoded string. |
This static method encodes the contents of the incoming data as a base64 encoded string.
The rfc3548 doesn't define the encoding of the input data, as base64 is a method to encode generic binary data and send them across the Internet. However, it's common practice to encode textual contents as utf-8 strings and then apply the base64 encoding.
This method automatically uses utf-8 encoding to transform strings with international characters. If this is not desired, provide a MemBuf as the parameter.