Skip to content

Instantly share code, notes, and snippets.

@devdave
Last active December 19, 2015 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save devdave/5892749 to your computer and use it in GitHub Desktop.
Save devdave/5892749 to your computer and use it in GitHub Desktop.
Python uuid1 colisions with Ubuntu 12.04 LTS Python 2.7.3
from uuid import uuid1
from time import time
def main():
test = dict()
limit = 10 ** 10
while limit:
limit -= 1
x = {n:uuid1().hex for n in range(15)}
if len(set(x.values())) != len(x.keys()):
print "Collision"
return
if __name__ == '__main__':
start = time()
main()
print time() - start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment