Skip to content

Instantly share code, notes, and snippets.

@cciollaro
Last active August 29, 2015 13:56
Embed
What would you like to do?
lowest sha512 sum in ruby
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