3 ms·
Fun fact: in Go, an IPv4 address is internally represented as an IPv6 address, starting with ten zeroes and two 0xffs. The IPv4 address is copied in the last fo
by wjholden 2y ago
Fun fact: in Go, an IPv4 address is internally represented as an IPv6 address, starting with ten zeroes and two 0xffs. The IPv4 address is copied in the last four bytes.
https://cs.opensource.google/go/go/+/refs/tags/go1.23.1:src/net/ip.go;l=53 https://cs.opensource.google/go/go/+/refs/tags/go1.23.1:src/...
This is called an IPv4-Mapped Address.
https://www.rfc-editor.org/rfc/rfc5156#section-2.2 https://www.rfc-editor.org/rfc/rfc5156#section-2.2