4 ms·
Obviously the point of the article is to not manually parse ip addresses. Well actually, python can do that just as well as all the other languages. >>> i
by throwaway12iii 8y ago
Obviously the point of the article is to not manually parse ip addresses.
Well actually, python can do that just as well as all the other languages.
>>> import ipaddress
>>> ipaddress.ip_address('2001:db8::')
IPv6Address('2001:db8::')
- throwaway12iii 8y agoWhy don't you rewrite that in rust? use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; let localhost_v6 = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)); assert_eq!("::1".parse(), Ok(localhost_v6));
- throwaway12iii 8y agoActually, in Java you can just use InetAddress.getByName.
- throwaway12iii 8y agoman 3 getaddrinfo