Skip to content

Instantly share code, notes, and snippets.

@tomgullo
Last active December 23, 2015 21:39
Show Gist options
  • Save tomgullo/6698304 to your computer and use it in GitHub Desktop.
Save tomgullo/6698304 to your computer and use it in GitHub Desktop.
convert_ipv6
import java.net.InetAddress
InetAddress ia = InetAddress.getByName("2001:0:4137:9e76:34b7:2e31:3f57:fd9a")
def bi = new BigInteger(ia.getAddress())
println bi
println InetAddress.getByAddress(bi.toByteArray())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment