Sha256: 3cf18c97c58c722bb4038d7e60d87ae32062d65d0b04434502cdcf817d148118

Contents?: true

Size: 577 Bytes

Versions: 5

Compression:

Stored size: 577 Bytes

Contents

module SimpleAuth
  class Config
    # Generate the password hash. The specified block should expected
    # the plain password and the password hash as block parameters.
    cattr_accessor :crypter
    @@crypter = proc do |password, salt|
      Digest::SHA256.hexdigest [password, salt].join("--")
    end

    # Generate the password salt. The specified block should expect
    # the ActiveRecord instance as block parameter.
    cattr_accessor :salt
    @@salt = proc do |record|
      Digest::SHA256.hexdigest [Time.to_s, SecureRandom.hex(32)].join("--")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
simple_auth-2.0.4 lib/simple_auth/compat/config.rb
simple_auth-2.0.3 lib/simple_auth/compat/config.rb
simple_auth-2.0.2 lib/simple_auth/compat/config.rb
simple_auth-2.0.1 lib/simple_auth/compat/config.rb
simple_auth-2.0.0 lib/simple_auth/compat/config.rb