class
Importance_2
Ruby latest stable (v2_5_5) - 0 notes - Superclass: Class

Class deprecated or moved

This class is deprecated or moved on the latest stable version. The last existing version (v2_1_10) is shown here.

digest/hmac.rb

An experimental implementation of HMAC keyed-hashing algorithm

Overview

CAUTION: Use of this library is discouraged, because this implementation was meant to be experimental but somehow got into the 1.9 series without being noticed. Please use OpenSSL::HMAC in the “openssl” library instead.

Examples

require 'digest/hmac'

# one-liner example
puts Digest::HMAC.hexdigest("data", "hash key", Digest::SHA1)

# rather longer one
hmac = Digest::HMAC.new("foo", Digest::RMD160)

buf = ""
while stream.read(16384, buf)
  hmac.update(buf)
end

puts hmac.hexdigest
Show files where this class is defined (1 file)
Register or log in to add new notes.