my $af = $ip =~ /\./ ? AF_INET : AF_INET6; my $bytes = pack("H32 a* H32", $packing[0], inet_pton( $af, $ip ), $packing[7]); return sha3_256_hex($bytes);