Sha256: 8fe9fcaa84a79a54318a3a28916d385177c51b2b1a2c57744d072b72ad47497a

Contents?: true

Size: 453 Bytes

Versions: 3

Compression:

Stored size: 453 Bytes

Contents

require 'oauth/signature/base'

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

module OAuth::Signature::HMAC
  class SHA1 < ::OAuth::Signature::Base
    implements 'hmac-sha1'

    def digest
      if RUBY_VERSION >= "1.9"
        Digest::HMAC.new(secret, Digest::SHA1).digest(signature_base_string)
      else
        ::HMAC::SHA1.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/sha1.rb
drogus-oauth-0.3.7 lib/oauth/signature/hmac/sha1.rb
drogus-oauth-0.3.6 lib/oauth/signature/hmac/sha1.rb