Class: FlexPass::Coders::SHA2Hash
- Inherits:
-
String
- Object
- String
- FlexPass::Coders::SHA2Hash
- Defined in:
- lib/flex_pass/coders/sha2_hash.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #==(secret) ⇒ Object
-
#initialize(raw_hash, bit_len = 256) ⇒ SHA2Hash
constructor
A new instance of SHA2Hash.
Constructor Details
#initialize(raw_hash, bit_len = 256) ⇒ SHA2Hash
Returns a new instance of SHA2Hash.
12 13 14 15 |
# File 'lib/flex_pass/coders/sha2_hash.rb', line 12 def initialize(raw_hash, bit_len = 256) self.replace(raw_hash) @bit_len = bit_len end |
Class Method Details
Instance Method Details
#==(secret) ⇒ Object
17 18 19 |
# File 'lib/flex_pass/coders/sha2_hash.rb', line 17 def ==(secret) super(Digest::SHA2.new(@bit_len).hexdigest(secret)) end |