-
-
Save anonymous/a0470688b3d78344164de31123312979 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
require 'digest' | |
base = "Cerutti Gino" | |
def prs(s, d) | |
puts "sha256(\"#{s}\") = #{"%e" % d}" | |
end | |
def hash(s) | |
h = Digest::SHA256.hexdigest(s) | |
"%078d" % h.to_i(16) | |
end | |
d = hash(base) | |
prs(base, d) | |
0.upto(10) do |i| | |
s = "#{base} #{i}" | |
d = hash(s) | |
prs(s,d) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment