Sha256: 9820bb581a298609a08db7b96e294739b21b59ac895e718dca7fc6b0682b957a

Contents?: true

Size: 560 Bytes

Versions: 37

Compression:

Stored size: 560 Bytes

Contents

require "bcrypt"

module Devise
  module Encryptors
    # = BCrypt
    # Uses the BCrypt hash algorithm to encrypt passwords.
    class Bcrypt < Base

      # Gererates a default password digest based on stretches, salt, pepper and the
      # incoming password. We don't strech it ourselves since BCrypt does so internally.
      def self.digest(password, stretches, salt, pepper)
        ::BCrypt::Engine.hash_secret([password, pepper].join, salt, stretches)
      end

      def self.salt
        ::BCrypt::Engine.generate_salt
      end

    end
  end
end

Version data entries

37 entries across 32 versions & 7 rubygems

Version Path
graffititracker_devise-1.0.11 lib/devise/encryptors/bcrypt.rb
devise-1.0.11 lib/devise/encryptors/bcrypt.rb
devise-1.0.10 lib/devise/encryptors/bcrypt.rb
devise_ennder-1.4.1.0.9 lib/devise/encryptors/bcrypt.rb
devise_ennder-1.4.1.0.9 test/rails_app/vendor/plugins/devise/lib/devise/encryptors/bcrypt.rb
devise_ennder-1.3.1.0.9 test/rails_app/vendor/plugins/devise/lib/devise/encryptors/bcrypt.rb
devise_ennder-1.3.1.0.9 lib/devise/encryptors/bcrypt.rb
devise_ennder-1.2.1.0.9 lib/devise/encryptors/bcrypt.rb
devise_ennder-1.2.1.0.9 test/rails_app/vendor/plugins/devise/lib/devise/encryptors/bcrypt.rb
devise_ennder-1.1.1.0.9 lib/devise/encryptors/bcrypt.rb
devise_ennder-1.1.1.0.9 test/rails_app/vendor/plugins/devise/lib/devise/encryptors/bcrypt.rb
devise_ennder-1.0.1.0.9 lib/devise/encryptors/bcrypt.rb
devise_ennder-1.0.1.0.9 test/rails_app/vendor/plugins/devise/lib/devise/encryptors/bcrypt.rb
devise-1.0.9 lib/devise/encryptors/bcrypt.rb
dcu-devise-1.0.7 lib/devise/encryptors/bcrypt.rb
devise-1.0.8 lib/devise/encryptors/bcrypt.rb
ivanvc-devise-1.0.7.1 lib/devise/encryptors/bcrypt.rb
mongoid-devise-1.0.1 lib/devise/encryptors/bcrypt.rb
devise-1.0.7 lib/devise/encryptors/bcrypt.rb
devise-1.1.rc1 lib/devise/encryptors/bcrypt.rb