Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
In an exercise of experimentation I'm seeing if I can get a uuid4 collision in less than 20,000,000.
import sys
import uuid
ids = set()
try:
while True:
id = uuid.uuid4()
if id in ids:
break
ids.add(id)
l = len(ids)
if l % 10000 == 0:
print l
except KeyboardInterrupt:
pass
print len(ids)
sys.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.