Sha256: 780c37b64edacef72c989bc97dd7c007be599c04fb843115c1a64932bdc52ba3

Contents?: true

Size: 301 Bytes

Versions: 13

Compression:

Stored size: 301 Bytes

Contents

# 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

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
trocla-0.4.0 lib/trocla/formats/ssha.rb
trocla-ruby2-0.4.0 lib/trocla/formats/ssha.rb
trocla-0.3.0 lib/trocla/formats/ssha.rb
trocla-0.2.3 lib/trocla/formats/ssha.rb
trocla-0.2.2 lib/trocla/formats/ssha.rb
trocla-0.2.1 lib/trocla/formats/ssha.rb
trocla-0.2.0 lib/trocla/formats/ssha.rb
trocla-0.1.2 lib/trocla/formats/ssha.rb
trocla-0.1.1 lib/trocla/formats/ssha.rb
trocla-0.1.0 lib/trocla/formats/ssha.rb
trocla-0.0.12 lib/trocla/formats/ssha.rb
trocla-0.0.11 lib/trocla/formats/ssha.rb
trocla-0.0.10 lib/trocla/formats/ssha.rb