suve

awful: function: hex-encode

Available since rev.36 (v.0.5.0).

Declaration

ascii :hex-encode ( string $MESSAGE )
ascii :encodeHex ( string $MESSAGE )

Summary

Returns a hexadecimal representation of given string.

Example

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

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

wikistrona zmodyfikowana 2014/0601/2317