Skip to content

Instantly share code, notes, and snippets.

@c-goes
Last active January 3, 2020 20:56
Show Gist options
  • Save c-goes/9da5a9de09c0e2b6188d084be97b00ce to your computer and use it in GitHub Desktop.
Save c-goes/9da5a9de09c0e2b6188d084be97b00ce to your computer and use it in GitHub Desktop.
IPv6 ULA generator
import string
import random
h = string.hexdigits[:16]
def c(l):
return ''.join(random.choice(h) for _ in range(l))
print(f"fd{c(2)}:{c(4)}:{c(4)}::/48")
print(f"fd{c(2)}:{c(4)}:{c(4)}:{c(4)}::/64")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment