Encodes the
IPv6 address using zero-compression on the leftmost
longest string of zeroes in the address. Per
RFC 5952 Section
5, this uses mixed notation when encoding an IPv4-mapped IPv6
address:
>>> T.putStrLn $ IPv6.encode $ IPv6.fromWord16s 0xDEAD 0xBEEF 0x0 0x0 0x0 0x0 0x0 0x1234
dead:beef::1234
>>> T.putStrLn $ IPv6.encode $ IPv6.fromWord16s 0x0 0x0 0x0 0x0 0x0 0xFFFF 0x6437 0xA5B4
::ffff:100.55.165.180
>>> T.putStrLn $ IPv6.encode $ IPv6.fromWord16s 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
::
Per
Section 4.2.2 of the same RFC, this does not use
:: to shorten a single 16-bit 0 field. Only runs of multiple
0 fields are considered.