portable encoding of IP addresses