class
Ruby latest stable (v2_5_5)
-
0 notes
- Superclass:
Class
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
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