Last active
August 29, 2015 13:56
-
-
Save cciollaro/9041062 to your computer and use it in GitHub Desktop.
lowest sha512 sum in ruby
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' | |
input = ARGV.first || "chris" | |
lowest_digest = Digest::SHA512.hexdigest(input) | |
lowest_input = input | |
begin | |
loop do | |
digest = Digest::SHA512.hexdigest(input) | |
if digest < lowest_digest | |
lowest_digest = digest | |
lowest_input = input | |
end | |
input = digest | |
end | |
rescue Exception | |
puts lowest_digest | |
puts lowest_input | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment