decode

Syntax

%decode(arg1[,algorithm])

algorithm can be b64 or hex. default is b64.

Description

Takes an ASCII encoded argument and decodes it to binary with either the base-64 or hex algorithms. Base-64 is "standard" on the internet, and is often (mistakenly) referred to as "uuencode". Hex encoding is "easier to decode" for programmers who may not have a base-64 decoding algorithm lying around.

You can use this for binary file transfer, or for getting back the binary results of the %encrypt() macro after you %encode() it, or any other situation in which ASCII encoding/decoding is useful.

Example

%decode(aGVsbG8=,b64) = hello
%decode(aGVsbG8=) = hello
%decode(68656c6c6f,hex) = hello

See Also

encode