blob: a2e0d02a21d719c8f23d11f624725f0e1c2f3ddf (
plain)
1
2
3
4
5
6
7
8
9
|
# salted crypt
require 'base64'
require 'digest'
class Trocla::Formats::Ssha < Trocla::Formats::Base
def format(plain_password,options={})
salt = options['salt'] || Trocla::Util.salt(16)
"{SSHA}"+Base64.encode64("#{Digest::SHA1.digest("#{plain_password}#{salt}")}#{salt}").chomp
end
end
|