Skip to content

Instantly share code, notes, and snippets.

@xanderlent
Last active June 28, 2023 12:41
Show Gist options
  • Save xanderlent/489799d25f2e4c26c58cd3d6f32c750b to your computer and use it in GitHub Desktop.
Save xanderlent/489799d25f2e4c26c58cd3d6f32c750b to your computer and use it in GitHub Desktop.
IPv6 ULA Random Prefix Generator (Python one-liner)
import secrets; prefix = list("fd" + secrets.randbits(40).to_bytes(5, "big").hex() + "::/48"); prefix.insert(4, ":"); prefix.insert(9, ":"); print("".join(prefix))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment