Base 64 Decode

Description

The zoho.encryption.base64Decode task is used to decode text that is encoded in base 64 format.

Info: If a character set was specified during encoding, the same character set must be used during decoding. Using a different character set may result in incorrect output.

Syntax

<response> = zoho.encryption.base64Decode(<data>, <source_character_set>);

where:

ParametersData typeDescription
<response>TEXTVariable that stores the decoded value returned as the response
<data>TEXTRepresents the Base64 encoded text that needs to be decoded
<source_character_set>
(Optional)
TEXT

Specifies the character set used during encoding. If not specified, the default character set is applied

Supported Values

  • UTF-8 (Default)
  • UTF-16LE
  • UTF-16BE

Example 1: Decode base 64 encoded text

The following script decodes the base 64 encoded text - am9obkB6eWxrZXIuY29t and returns the original text - john@zylker.com.

response = zoho.encryption.base64Decode("am9obkB6eWxrZXIuY29t");

where:

response
The TEXT response that represents the decoded text
"am9obkB6eWxrZXIuY29t"
The TEXT that represents the base 64 encoded text that needs to be decoded

Example 2: Decode text using a specific character set

The following script decodes Base64 encoded text using the UTF-16LE character set.

encoded_value = "AGEAcABpAF8AawBlAHk=";
response = zoho.encryption.base64Decode(encoded_value, "UTF-16LE");
// Returns api_key

where:

response
The TEXT response representing the decoded output
encoded_value
The TEXT containing the Base64 encoded data
"UTF-16LE"
Specifies the character set used for decoding

Related links