Skip to content

Instantly share code, notes, and snippets.

@kingkorf
Created December 14, 2012 16:16
Show Gist options
  • Save kingkorf/4286600 to your computer and use it in GitHub Desktop.
Save kingkorf/4286600 to your computer and use it in GitHub Desktop.
Ruby SHA1 generator
#!/usr/bin/env ruby
require 'rubygems'
require 'highline/import'
require 'digest/sha1'
password = ask("Password: ") { |q| q.echo = false }
repeat = ask("Repeat: ") { |q| q.echo = false }
if password != repeat
abort("Passwords don't match...")
end
puts "SHA1: " + Digest::SHA1.hexdigest(password)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment