Sha256: c34446e6a5caca2b2c2451ce3a815c6c82a9de2fd69583e1564b17e946c906c6

Contents?: true

Size: 425 Bytes

Versions: 3

Compression:

Stored size: 425 Bytes

Contents

require 'oauth/signature/base'

if RUBY_VERSION >= "1.9"
  require 'digest/hmac'
else
  require 'hmac-md5'
end

module OAuth::Signature::HMAC
  class MD5 < OAuth::Signature::Base
    implements 'hmac-md5'

    def digest
      if RUBY_VERSION >= "1.9"
        Digest::HMAC.new(secret, Digest::MD5).digest(signature_base_string)
      else
        ::HMAC::MD5.digest(secret, signature_base_string)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
qoobaa-oauth-0.3.8 lib/oauth/signature/hmac/md5.rb
drogus-oauth-0.3.7 lib/oauth/signature/hmac/md5.rb
drogus-oauth-0.3.6 lib/oauth/signature/hmac/md5.rb