Class: Trocla::Formats::Ssha
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
expensive, #expensive?, expensive?, #initialize, #render
Constructor Details
This class inherits a constructor from Trocla::Formats::Base
Instance Method Details
#format(plain_password, options = {}) ⇒ Object
5 6 7 8 |
# File 'lib/trocla/formats/ssha.rb', line 5 def format(plain_password,={}) salt = ['salt'] || Trocla::Util.salt(16) "{SSHA}"+Base64.encode64("#{Digest::SHA1.digest("#{plain_password}#{salt}")}#{salt}").chomp end |