Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import itertools
- def test():
- hashes = set()
- for i in itertools.count():
- # generate 2 bytes = 16 bits of randomness, twice
- a = os.urandom(2)
- if a in hashes:
- return i
- else:
- hashes.add(a)
- for i in range(100):
- print(test())
Advertisement
Add Comment
Please, Sign In to add comment