Description of MUSHclient world function: world.Base64Encode
||Encodes a string using base-64 encoding.
VARIANT Base64Encode(BSTR Text, BOOL MultiLine);
View list of data type meanings
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, however see below for a work-around for Lua.
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 version 3.22 onwards.
world.note world.base64encode ("swordfish", 0)
world.note (world.base64encode ("swordfish", 0));
$world->note ($world->base64encode ("swordfish", 0));
world.note (world.base64encode ("swordfish", 0))
Note (Base64Encode ("swordfish", 0))
The multi-line flag is optional, and defaults to false.
In MUSHclient version 3.57 onwards you can also use
encoded_string = utils.base64encode (s, [, linebreaks] )
This works the same as described above, however it will correctly handle strings with the null (hex 00) character in them.
The encoded string.
|Introduced in version
See also ...
||Takes a base-64 encoded string and decodes it.
Search for script function
Enter a word or phrase in the box below to narrow the list down to those that match.
The function name, prototype, summary, and description are searched.
Leave blank to show all functions.
Many functions return a "code" which indicates the success or otherwise
of the function.
view a list of the return codes
The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).
view a list of the data types used in function prototypes
View all functions
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.
Gammon Software support
Forum RSS feed ( https://gammon.com.au/rss/forum.xml )