Snowflake UDF: TO_IP6 - Convert IPv6 Hex Value to its IPv6 string equivalent

TO_IP6 Lets you convert IPv6’s hex equivalent to it’s IPv6 IP format

In our Snowflake listings, we package our listings with helpful functions that make using our data super easy. In that pursuit, we have developed the TO_IP6 function that converts the hex equivalent of the IPv6 address to its IP string format.

One IPv6 IP Address in hex format

Input IP Address:

88F8B8B4629D79A313DC2962B7B02718

Code:

SELECT ipinfo.public.to_ip6('88F8B8B4629D79A313DC2962B7B02718') as IPv6

Output:

image


Multiple IPv6 IP addresses in hex format

Input IP addresses:

88F8B8B4629D79A313DC2962B7B02718
C4CE30A251833390A53058D8A7CB2F51
BFE8923DDCD49CE100E81CE1C05F7EB9
938B42094FCD8FECE4F42F28D1065D41
9CD965ECD6147848ED4FB6F1580F3361
E9761520233818F11A824523915BBD02
BC04EC1794E4685C6236817DE7735B06
D033679637F74AB559481F1C0AC0FDBA
15FC63F329ADAC2BE0F796DC7064BD59
1E79A062AB8C5FF2107072830B44610B

Code:

SELECT ipinfo.public.to_ip6(ip) from logs
-- logs contains IPv6 hex equivalent values

Output:

image


Relevant Docs

Relevant Databases

:link: IPinfo Snowflake Documentation

1 Like