Hello guys,
can I ask you for some small help?
I deal with one Java snippet configuration and I am not clear of it.
Let’s have an example of one input column from table creator called ipv6 full of ipv6 addresses.
The task is recalculate them into number. For ip4 the task is easy, but how to deal with ipv6?
I found one java code which should be able do that, but I don\t know how to configure Java snippet with it.
Thank you in advance!
Code is here:
java.math.BigInteger Dot2LongIP(String ipv6) {
java.net.InetAddress ia = java.net.InetAddress.getByName(ipv6);
byte byteArr[] = ia.getAddress();
if (ia instanceof java.net.Inet6Address) {
java.math.BigInteger ipnumber = new java.math.BigInteger(1, byteArr);
return ipnumber;
}
}
Screen here: