Skip to content
instance method

OpenSSL::HMAC#reset

() -> self
hmac.reset → self

Returns hmac as it was when it was first initialized, with all processed data cleared from it.

Example

Example
data = "The quick brown fox jumps over the lazy dog"
instance = OpenSSL::HMAC.new('key', 'SHA1')
#=> f42bb0eeb018ebbd4597ae7213711ec60760843f

instance.update(data)
#=> de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9
instance.reset
#=> f42bb0eeb018ebbd4597ae7213711ec60760843f
See also #inspect #to_s #hexdigest #update also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0