Created
July 5, 2014 23:42
-
-
Save bcicen/b016f07a7b501c8243d7 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
import random | |
ranges = [ | |
32767, | |
2147483647, | |
9223372036854775807, | |
] | |
for range in ranges: | |
print('generating integers in range 0-%i') % range | |
count = 0 | |
cur_rand = 0 | |
last_rand = 1 | |
while cur_rand != last_rand: | |
last_rand = cur_rand | |
cur_rand = (random.randint(0,range) % 100000) | |
count += 1 | |
print('found sequential random collision after %i iterations') % (count) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment