base64. Decoding from Base64   [3.1.5]

^string:base64[encoded]
^string:base64[encoded;
options]   [3.4.2]

Note: this is method, not a constructor!


Decodes a string from Base64 representation. To encode a string use ^string.base64[].

Options hash can be specified:
·$.strict(true) - the exception will be raised if all characters can not be decoded. Without this option the only charachers that are decoded successfully are returned.   [3.4.2]  
·$.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.   [3.4.6]  
·$.pad(true/false) - if the coded length was not divisible by 3, padding characters (=) were added, by default.   [3.4.6]  

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

Example
$encoded[
pyAxOTczLiBUaGVyZSBhcmUgcnVtb3VycyB0aGF0IJNHcmVlbiBzbGVldmVzlCB3ZXJlIHdyaXR0
ZW4gYnmF
]
$original[^string:base64[$encoded]]
$original

Outputs…
§ 1973. There are rumours that "Green sleeves" were written by…


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