Guest User

Untitled

a guest
Jul 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. srand(123) # Seed Random Generator for Reproducibility
  4.  
  5. loop_connection = 1_000_000 + rand(1_000_000)
  6. real_end = loop_connection + 10 + rand(500_000) # loop size is from 10 to 500k
  7.  
  8. def rand_128bits_in_hex
  9. # Return string is between hex 1000_0000 and ffff_ffff
  10. ("10000000".hex + rand("ffffffff".hex - "10000000".hex)).to_s(16)
  11. end
  12.  
  13. (loop_connection).times{puts rand_128bits_in_hex}
  14. loop do
  15. srand(124) # Re-Seed Random Generator to make a loop
  16. (real_end - loop_connection).times{puts rand_128bits_in_hex}
  17. end
Add Comment
Please, Sign In to add comment