Class: DeviseMeteor::Hasher
- Inherits:
-
Object
- Object
- DeviseMeteor::Hasher
- Defined in:
- lib/devise_meteor/strategies/hasher.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
readonly
Returns the value of attribute algorithm.
Instance Method Summary collapse
-
#encode(password, salt) ⇒ String
Returns given password encoded with the given salt.
-
#must_update(encoded) ⇒ Boolean
Returns if given encoded password needs to be updated.
-
#salt ⇒ String
Returns salt value to be used for hashing.
-
#verify(password, encoded) ⇒ Boolean
Returns if the given password match the encoded password.
Instance Attribute Details
#algorithm ⇒ Object (readonly)
Returns the value of attribute algorithm.
7 8 9 |
# File 'lib/devise_meteor/strategies/hasher.rb', line 7 def algorithm @algorithm end |
Instance Method Details
#encode(password, salt) ⇒ String
Returns given password encoded with the given salt.
30 31 32 |
# File 'lib/devise_meteor/strategies/hasher.rb', line 30 def encode(password, salt) raise NotImplementedError end |
#must_update(encoded) ⇒ Boolean
Returns if given encoded password needs to be updated.
38 39 40 |
# File 'lib/devise_meteor/strategies/hasher.rb', line 38 def must_update(encoded) false end |
#salt ⇒ String
Returns salt value to be used for hashing.
12 13 14 |
# File 'lib/devise_meteor/strategies/hasher.rb', line 12 def salt SecureRandom.hex(9) end |
#verify(password, encoded) ⇒ Boolean
Returns if the given password match the encoded password.
21 22 23 |
# File 'lib/devise_meteor/strategies/hasher.rb', line 21 def verify(password, encoded) raise NotImplementedError end |