3 ms·
An IP address is fundamentally a 32-bit or 128-bit binary number, and hexadecimal is the most human-friendly base to represent those. Decimal gets pretty hairy
by p1mrx 5y ago
An IP address is fundamentally a 32-bit or 128-bit binary number, and hexadecimal is the most human-friendly base to represent those. Decimal gets pretty hairy once you introduce CIDR prefixes that aren't 8-bit aligned.
The [IPv6]:port syntax is unfortunate, but I'm not sure what they'd have done instead. Dotted hexadecimal would be ambiguous, because "1.2.3.4.5.6.beef.de" looks like a DNS hostname.
Zero compression exists because it's more convenient than writing all those zeroes, especially with CIDR prefixes like "2000::/3".
- laurensr 5y agoI think browser are advanced enough to parse [IPv6]:port. Note that they can even distinguish octal and decimal IPs, for example this is working in Chrome, Firefox and the Windows ping utility: http://0100.0351.0251.0152/ http://0100.0351.0251.0152/ As well as decimal: http://1089055082/ http://1089055082/ Both lead to google.com
- p1mrx 5y ago> I think browser are advanced enough to parse [IPv6]:port. Except for recent versions of Firefox Mobile: https://github.com/mozilla-mobile/fenix/issues/4343 https://github.com/mozilla-mobile/fenix/issues/4343