Skip to content

Instantly share code, notes, and snippets.

@psi
Created February 20, 2013 20:12
Show Gist options
  • Save psi/4999097 to your computer and use it in GitHub Desktop.
Save psi/4999097 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'active_support'
if ARGV.empty?
puts "Usage: ./bin/crypt [password]"
exit
end
password = ARGV[0]
salt = ActiveSupport::SecureRandom.base64(16)[0..1]
puts password.crypt(salt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment