method

reset

Importance_1
reset() public

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

Example

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

instance.update(data)
#=> de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9
instance.reset
#=> f42bb0eeb018ebbd4597ae7213711ec60760843f
Show source
Register or log in to add new notes.