Created
December 14, 2012 16:16
-
-
Save kingkorf/4286600 to your computer and use it in GitHub Desktop.
Ruby SHA1 generator
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
#!/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