Skip to content

Instantly share code, notes, and snippets.

@cciollaro
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cciollaro/9041062 to your computer and use it in GitHub Desktop.
Save cciollaro/9041062 to your computer and use it in GitHub Desktop.
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