How should I perform conversion from IPv6 to long and vice versa?
So far I have:
public static long IPTo
You can also use java.net.InetAddress It works with both ipv4 and ipv6 (all formats)
public static BigInteger ipToBigInteger(String addr) { InetAddress a = InetAddress.getByName(addr) byte[] bytes = a.getAddress() return new BigInteger(1, bytes) }