class OpenSSL::HMAC
def digest(digest, key, data)
hmac = OpenSSL::HMAC.digest('SHA1', key, data)
data = 'The quick brown fox jumps over the lazy dog'
key = 'key'
=== Example
the algorithm name or an instance of OpenSSL::Digest.
specifies the digest algorithm to use. This may be a String representing
Returns the authentication code as a binary string. The _digest_ parameter
HMAC.digest(digest, key, data) -> aString
:call-seq:
def digest(digest, key, data) hmac = new(key, digest) hmac << data hmac.digest end unless method_defined?(:digest) # JRuby