base64. Encoding to Base64   [3.1.5]

^string.base64[]
^string.base64[options]   [3.4.6]

Method encodes string to Base64 representation. To decode a string from Base64 to it's original, use
^string:base64[encoded].

Options hash can be specified:
·$.wrap(true/false) - return the result with line breaks (by default) or as a single line.  
·$.url-safe(false/true) - use the modified alphabet, with all characters do not need to be converted into %XX in the URL ('-' è '_' are used instead of '+' and '/' ) . Do not use by default.  
·$.pad(true/false) - append padding characters (=), if the coded length is not divisible by 3. Append by default.  


Detailed information on Base64 is available here: http://www.ietf.org/rfc/rfc2045.txt
and here http://en.wikipedia.org/wiki/Base64.

Example
$original[§ 1973. There are rumours that "Green sleeves" were written by…]
<pre>^original.base64[]</pre>

Outputs…
pyAxOTczLiBUaGVyZSBhcmUgcnVtb3VycyB0aGF0IJNHcmVlbiBzbGVldmVzlCB3ZXJlIHdyaXR0
ZW4gYnmF



Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 26.01.2021