bt_bencode
bt_bencode copied to clipboard
Add ByteIpAddr type serialize to byte representation
In BitTorrent BEP10, extend handshake sends IPv6/IPv4 address in a "compact form", which is the big-endian byte representation, represented by byte string length of 4(ipv4)/16(ipv6). This commit adds a ByteIpAddr type to serialize and deserialize between core::IpAddr and byte string representation.