GOLF(2gg)

NAME
decode-hex - (hex-encoding)

PURPOSE
Decode hexadecimal string into data.

SYNTAX

        decode-hex <data> to <output> \
            [ input-length <input length> ]

DESCRIPTION
decode-hex will decode hexadecimal string <data> to string <output> given in "to" clause.

<data> must consist of an even number of digits 0-9 and letters A-F or a-f. The length of <data> may be given by <input length> number in "input-length" clause, otherwise it is assumed to be the string length of <data>.

EXAMPLES
Get the original binary data from a hexadecimal string "hexdata". The output string "binout" is created:

        set-string hexdata = "0041000F414200"
        decode-hex hexdata to binout

The value of "binout" will be binary data equal to this C literal:

        "\x00""A""\x00""\xF""AB""\x00""\x04"

SEE ALSO
 Hex encoding

decode-hex encode-hex See all documentation