Method String.hex2string()


Method hex2string

string(8bit) hex2string(string(8bit) hex, int(0..2)|void strict_mode)

Description

Convert a string of hexadecimal digits to binary data.

Parameter hex

String containing hexadecimal characters.

Parameter strict_mode

Level of strictness. Defaults to 0:

0

Traditional mode: Non-hexadecimal characters will be ignored when between tuples. Eg. "Z00 00" is ok, but "0 00Z0" isn't.

1

Lenient mode: Only Control characters and white-space will be ignored when between tuples. Eg. "00 00" is ok, but "Z00 00" and "0 000" are not.

2

Strict mode: No non-hexadecimal characters are allowed.

Note

The strict_mode parameter was added in Pike 9.0.

See also

string2hex()