Sha256: 53be70bb1598831b60f9874a40b8b3bfcfc0054c6c75069f199cc82ae3ffa7c2

Contents?: true

Size: 441 Bytes

Versions: 3

Compression:

Stored size: 441 Bytes

Contents

require "pbkdf2"

module Shield
  module Password
    module PBKDF2
      extend Shield::Password::Simple

      def self.digest(password, salt)
        ::PBKDF2.new do |p|
          p.password = password
          p.salt = salt
          p.iterations = iterations
          p.hash_function = :sha512
        end.hex_string
      end

      class << self
        attr_accessor :iterations
      end
      @iterations = 5000
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shield-0.1.0 lib/shield/password/pbkdf2.rb
shield-0.1.0.rc1 lib/shield/password/pbkdf2.rb
shield-0.0.4 lib/shield/password/pbkdf2.rb