-
-
Save graingert/5893367 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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