Guest User

Untitled

a guest
Jan 4th, 2024
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. import os
  2. import itertools
  3.  
  4. def test():
  5.     for i in itertools.count():
  6.         # generate 2 bytes = 16 bits of randomness, twice
  7.         a = os.urandom(2)
  8.         b = os.urandom(2)
  9.         # compare the two
  10.         if a == b:
  11.             return i
  12.  
  13. for i in range(100):
  14.     print(test())
  15.  
Advertisement
Add Comment
Please, Sign In to add comment