Created
April 16, 2018 12:24
-
-
Save mjansing/9bcc712a1281d85b96540496b7f05524 to your computer and use it in GitHub Desktop.
MajesticHeribert
This file contains hidden or 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
require 'digest' | |
text = "I am Heribert Innoq" | |
nonce = 0 | |
timeStart = Time.new | |
begin | |
nonce += 1 | |
input = "#{text}#{nonce}" | |
hash = Digest::SHA256.hexdigest(input) | |
puts "#{input} => #{hash}" | |
end while !hash.start_with? '000000' | |
timeEnd = Time.new | |
diff = timeEnd - timeStart | |
puts "Found a new proof with nonce: #{nonce} in #{diff} seconds." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment