Module: Veri::Password::BCrypt

Defined in:
lib/veri/password/bcrypt.rb

Class Method Summary collapse

Class Method Details

.create(password) ⇒ Object



8
9
10
# File 'lib/veri/password/bcrypt.rb', line 8

def create(password)
  ::BCrypt::Password.create(password)
end

.match?(hashed_password) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/veri/password/bcrypt.rb', line 16

def match?(hashed_password)
  hashed_password.start_with?("$2")
end

.verify(password, hashed_password) ⇒ Object



12
13
14
# File 'lib/veri/password/bcrypt.rb', line 12

def verify(password, hashed_password)
  ::BCrypt::Password.new(hashed_password) == password
end