Class: Devise::Encryptable::Encryptors::Argon2

Inherits:
Base
  • Object
show all
Defined in:
lib/devise/encryptable/encryptors/argon2.rb

Class Method Summary collapse

Class Method Details

.compare(encrypted_password, password, stretches, salt, pepper) ⇒ Object



11
12
13
# File 'lib/devise/encryptable/encryptors/argon2.rb', line 11

def self.compare(encrypted_password, password, stretches, salt, pepper)
  ::Argon2::Password.verify_password("#{password}#{salt}#{pepper}", encrypted_password)
end

.digest(password, stretches, salt, pepper) ⇒ Object



7
8
9
# File 'lib/devise/encryptable/encryptors/argon2.rb', line 7

def self.digest(password, stretches, salt, pepper)
  ::Argon2::Password.create("#{password}#{salt}#{pepper}")
end