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