base64Decode()

Decodes base64 encoded data.

Synopsis

int base64Decode(string encoded, string|blob &decoded);

Parameter

Parameters Description
encoded The data that should be decoded.
decoded The decoded data that is returned.

Return Value

Returns 0 on success or -1 if the given data is invalid (not conform to base64 encoding rules)

Description

The function decodes base 64 encoded data and returns it either as string or blob.

If the encoded data contains a 0-byte the data type for the decoded information must not be a string but a blob as a string cannot handle 0-bytes. In this case the return value of the function is -1.

Assignment

Miscellaneous functions

Availability

UI, CTRL

See also

base64Encode()