suve

awful: function: hex-decode

Available since rev.36 (v.0.5.0).

Declaration

ascii :hex-decode ( string $MESSAGE )
ascii :decodeHex ( string $MESSAGE )

Summary

Takes a string containing a hexadecimal sequence and returns the original data. Note that the data may turn out to be binary, not text.

Example

# :hex-decode example.
:set &enc :hex-decode s'48657861646563696d616c2034206c79666521'
:set &str s'Hexadecimal 4 lyfe!'

!if :eq $enc $str
    :writeln s"awful's hex-decode seems to work fine."
!else
    :writeln s"Uh-oh, it seems awful's hex-decode is broken!"
!fi

wikipage modified on 2014/0601/2317