encode
The encode
statement is used to base16 or base64 encode the contents of a variable or a named buffer.
Syntax
encode base16|base64
varName|{buffer_name}
Details
The encode
statement will encode the contents of an existing variable or named buffer, replacing those contents with the encoded version.
The result of encoding the contents will increase their length. With base16
encoding the new length will be double the original. With base64
encoding the new length will be greater than the original but the exact size increase will depend on the contents being encoded.
When encoding a variable, if the size of the result after encoding exceeds the maximum allowable length for a variable value (8095 characters) then the USE script will fail and an error will be returned.
Encoding an empty variable or buffer will produce an empty result
Example
The following script ...
... produces the following output:
Last updated