Skip to content

Instantly share code, notes, and snippets.

@mjansing
Created April 16, 2018 12:24
Show Gist options
  • Save mjansing/9bcc712a1281d85b96540496b7f05524 to your computer and use it in GitHub Desktop.
Save mjansing/9bcc712a1281d85b96540496b7f05524 to your computer and use it in GitHub Desktop.
MajesticHeribert
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