19.0.0 released Nov 08, 2023
Decode base64

Purpose: Base64 decode.

decode-base64 <data> to [ define ] <output data> \
    [ input-length <input length> ] \
    [ output-length [ define ] <output length> ]

decode-base64 will decode string <data> into <output data>, which can be binary data. <output data> is allocated memory.

If "input-length" clause is used, then <input length> is the number of bytes decoded, otherwise <data> is treated as a null-terminated string and its length determined.

The result is stored in <output data> (in "to" clause), which can be created with optional "define". The length of the decoded string can be obtained via "output-length" clause in <output length>, which can be created with optional "define".

<output data> will always have an extra null byte appended - this null byte is not included in length and is appended only as a safety precaution.

Note that the string to decode can have whitespaces before it (such as spaces or tabs), and whitespaces and new lines after it, which will be ignored for the purpose of decoding.
See encode-base64.
See also
See all

You are free to copy, redistribute and adapt this web page (even commercially), as long as you give credit and provide a dofollow link back to this page - see full license at CC-BY-4.0. Copyright (c) 2019-2023 Dasoftver LLC. Vely and elephant logo are trademarks of Dasoftver LLC. The software and information on this web site are provided "AS IS" and without any warranties or guarantees of any kind. Icons from table-icons.io copyright PaweĊ‚ Kuna, licensed under MIT license.