Sha256: 2e7407abad8a1a0f69dc0daa850971bd1988d4deaf5bd2dd893b92df5dddd53b
Contents?: true
Size: 580 Bytes
Versions: 11
Compression:
Stored size: 580 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(stretches) ::BCrypt::Engine.generate_salt(stretches) end end end end
Version data entries
11 entries across 11 versions & 2 rubygems