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