Created
February 26, 2016 14:23
-
-
Save kochd/d20158c88afb6fc72628 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
loop do | |
length = rand(1..(1024**3)) | |
puts "Writing #{length} bytes" | |
data = Random.new.bytes(length) | |
file = "rand_data_#{SecureRandom.hex(32)}" | |
File.open(file, "w") { |f| f.write data} | |
a = Digest::SHA512.hexdigest(File.read(file)) | |
b = Digest::SHA512.hexdigest(data) | |
fail "Missmatch" unless a == b | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment