hex (util v1.3.5)

View Source

Hexadecimal conversion functions

Author: Serge Aleynikov saleyn@gmail.com

Summary

Functions

Convert a hex digit in range [$0..$9,$a..$f,$A..$F] to integer.

Convert an integer to a hex digit in range [0..15].

Convert a hex string to binary.

Convert an iolist to a hex string.

Convert a hex string/binary to integer.

Functions

dehex/1

-spec dehex(char()) -> integer().

Convert a hex digit in range [$0..$9,$a..$f,$A..$F] to integer.

hex/1

-spec hex(integer()) -> char().

Convert an integer to a hex digit in range [0..15].

to_bin/1

-spec to_bin(string()) -> binary().

Convert a hex string to binary.

to_hex/1

-spec to_hex(integer() | iolist()) -> binary().

Convert an iolist to a hex string.

to_int/1

-spec to_int(string() | binary()) -> integer().

Convert a hex string/binary to integer.