Name Base64Encode
Type Method
Summary Encodes a string using base-64 encoding.
Prototype VARIANT Base64Encode(BSTR Text, BOOL MultiLine);
Description Encodes a string (like "swordfish") returning it as base-64 characters (eg. "c3dvcmRmaXNo").

Each 3 characters of input become 4 characters of output. This can be used:

a) as a primitive form of encryption (or 'information hiding')
b) to send non-printable characters as a text stream

Note that due to the way strings are represented internally, it is not possible for the encoded string to contain the NULL character (hex 0x00) and be returned correctly.

If "multiline" is true, then the returned string will have a carriage-return/linefeed after every 76 characters, otherwise it will be one long text stream.

Note: Available in MUSHclient version 3.22 onwards.
VBscript example
world.note world.base64encode ("swordfish", 0)
Jscript example
world.note (world.base64encode ("swordfish", 0));
PerlScript example
$world->note ($world->base64encode ("swordfish", 0));
Returns The encoded string.

See also ...