Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

OpenSSL::HMAC#<<

(::String data) -> self
<<(p1)

Alias of #update

Returns hmac updated with the message to be authenticated. Can be called repeatedly with chunks of the message.

Example

Example
first_chunk = 'The quick brown fox jumps '
second_chunk = 'over the lazy dog'

instance.update(first_chunk)
#=> 5b9a8038a65d571076d97fe783989e52278a492a
instance.update(second_chunk)
#=> de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9
See also #update .new #== .hexdigest also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0