IPv4/v6 address string
hexadecimal string of IP address
This function converts IPv4 or IPv6 address string to a hexadecimal string of IPv4 or IPv6 address.
iptohex("192.168.1.1") -> "c0a80101"
iptohex("2001:db8::4") -> "871020010db8000000000000000000000004"
iptohex("192.168.1.1/24") -> "c0a80101ffffff00"
iptohex("2001:db8::/120") -> "871020010db8000000000000000000000000ffffffffffffffffffffffffffffffffff00"
iptohex("zzz")) -> raise exception
convert IPv4/v6 addresss to a hexadecimal string