BASE64_DECODE

The function BASE64_DECODE decodes Text that has been encoded using base64 encoding.

This function accepts a String holding base64 encoded data and returns the decoded text of that data. Note that while base64 encoding can encode any arbitrary data, BASE64_DECODE only decodes plain text that was encoded. See Encoding in Airscript (URLs & Base64) for more details.

Declaration

BASE64_DECODE(base64_data) -> decoded_string

Parameters

base64_data (required, type: string)

A string containing base64 encoded data.

Return Values

decoded_string (type: string)

The decoded string.

Examples

The base64 encoding for the string "top secret!" is "dG9wIHNlY3JldCE=". This string can be decoded with BASE64_DECODE, making it not so top secret.

BASE64_DECODE("dG9wIHNlY3JldCE=") -> "top secret!"

Discussion

The function BASE64_ENCODE is the opposite operation to BASE64_DECODE. Rather than decoding a String, it will encode it. Encoding, and then decoding a String will produce the original String.

BASE64_DECODE(BASE64_ENCODE("Hello, world!")) -> "Hello, world"

Last updated