Created
January 24, 2011 23:06
-
-
Save alevchuk/794176 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
#!/usr/bin/env ruby | |
srand(123) # Seed Random Generator for Reproducibility | |
loop_connection = 1_000_000 + rand(1_000_000) | |
real_end = loop_connection + 10 + rand(500_000) # loop size is from 10 to 500k | |
def rand_128bits_in_hex | |
# Return string is between hex 1000_0000 and ffff_ffff | |
("10000000".hex + rand("ffffffff".hex - "10000000".hex)).to_s(16) | |
end | |
(loop_connection).times{puts rand_128bits_in_hex} | |
loop do | |
srand(124) # Re-Seed Random Generator to make a loop | |
(real_end - loop_connection).times{puts rand_128bits_in_hex} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment