Data Conversion
The following functions perform conversion to/from different types of data encoding.
%base64.encode( … )
Encode a string using Base64.
Example
string test
test := "Caipirinha"
reply.Reply-Message := "The base64 of %{test} is %base64.encode(test)"
Output
The base64 of foo is Q2FpcGlyaW5oYQ==
%base64.decode( … )
Decode a string previously encoded using Base64.
Example
string test
test := "Q2FpcGlyaW5oYQ=="
reply.Reply-Message := "The base64.decode of %{test} is %base64.decode(test)"
Output
The base64.decode of Q2FpcGlyaW5oYQ== is Caipirinha
%bin( … )
Convert string to binary.
Example
string test
test := "10"
reply.Reply-Message := "The %{test} in binary is %bin(test)"
Output
The 10 in binary is \020
%hex( … )
Convert to hex.
Example
string test
test := "12345"
reply.Reply-Message := "The value of %{test} in hex is %hex(test)"
Output
The value of 12345 in hex is 3132333435