base64. Encoding to Base64   [3.1.5]

^file.base64[]
^file.base64[options]   [3.4.6]

Method encodes file to Base64 representation. To decode a file from Base64 to it's original, use
^file::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[^file::load[binary;http://www.parser.ru/i/artlebedev.gif]]
<pre>^original.base64[]</pre>

Outputs…
R0lGODlhWgAlAMQAAP///4CAgOX0yb/jeKXXQtnurvn88uz318Xmhszok/L55KzaUJ/VNbnga9Lr
od/xvM/qmeXzx+PzxaXXQbLdXdHrndzvtbzhccvokaPWPMHje+Hyv8PlgcTlgpnSKAAAACH5BAEA
AB4ALAAAAABaACUAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7jXi/6HoDvNOwFhcEh8ohsLn9Hpc4I
FTpNxeyVWs1GvzsoOMksebtMbvPslOa4wKv5O04rgfSq/K0lo9h4I2qBT21lfGN7gnlrdnaGYIo3
cEmSkGiLj4CRO5RWbotimKKjnpY1nn5EjISFjaRaYamWm1t3qqagk320rKquhLmHPLy6l6+kyMJh
hXHGtbeavnqdxcN6qY6htac0s8/T0dvT3TOpGz0CAlh0BkgH0e7vXgYKsTkFRh4ISAP6oD789WBg
4F8CAAI9EMynD6ERAhCKENihQICBBXgWIOjQQ8GqBz0cYEyQDqOHCiEJ83jA0IMCSA8MHaiM6OGA
PX46DjRo2OMAtTkk9e0MooCBh4Q9hnrsEdRIgp0IENTcoZJBUFsj5EEhOUCdHqP+uq5j6JPpUQE+
AeQjQGCBrKNSf/Uo8ICDBw2L1goo0DWdPwJ6+VrooXGuBwJ7uxYMGSbu0Cv5rE7wkCFU3MMCEhLw
eRkxQ5MAOq8T6DGMAq0nSke4IOGEAbRZYcdOC+B1ide0menezbu379/Amf0bTry48ePIkytfzry5
8+fQPQQIYGR6deo9rEffzr04durfpWcXT767efPhxacvf749dOzkwY9n777+8unatUv/jt++/+Qh
AAA7



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