Module: Veri::Password::SCrypt
- Defined in:
- lib/veri/password/scrypt.rb
Class Method Summary collapse
- .create(password) ⇒ Object
- .match?(hashed_password) ⇒ Boolean
- .verify(password, hashed_password) ⇒ Object
Class Method Details
.create(password) ⇒ Object
8 9 10 |
# File 'lib/veri/password/scrypt.rb', line 8 def create(password) ::SCrypt::Password.create(password) end |
.match?(hashed_password) ⇒ Boolean
16 17 18 |
# File 'lib/veri/password/scrypt.rb', line 16 def match?(hashed_password) hashed_password.match?(/\A\h+\$\h+\$\h+\$/) end |
.verify(password, hashed_password) ⇒ Object
12 13 14 |
# File 'lib/veri/password/scrypt.rb', line 12 def verify(password, hashed_password) ::SCrypt::Password.new(hashed_password) == password end |