Base 64 Decode
Table of Contents
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:
| Parameters | Data type | Description |
|---|---|---|
| <response> | TEXT | Variable that stores the decoded value returned as the response |
| <data> | TEXT | Represents 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
|
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:
responseThe 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:
responseThe TEXT response representing the decoded output
encoded_valueThe TEXT containing the Base64 encoded data
"UTF-16LE"Specifies the character set used for decoding