Sha256: 9d8295c12bdf3f7d1a8c1f50e803436bf05627a0104373018a93afccfa2f62d0

Contents?: true

Size: 304 Bytes

Versions: 2

Compression:

Stored size: 304 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

2 entries across 2 versions & 1 rubygems

Version Path
trocla-0.5.1 lib/trocla/formats/ssha.rb
trocla-0.5.0 lib/trocla/formats/ssha.rb