Sha256: e22f9873d3f59c88ce551fda6f5bf2822dcce30538b432c7ac9389b135151c89

Contents?: true

Size: 290 Bytes

Versions: 8

Compression:

Stored size: 290 Bytes

Contents

#!/usr/bin/ruby
#encoding=utf-8

require 'base64'
require 'openssl'

module JFoundry 
    module Signer
        def sign secret_key, string_to_sign, digest = 'sha1'
            return Base64.encode64(OpenSSL::HMAC.digest(digest, secret_key, string_to_sign)).strip
        end 
    end 
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jfoundry-0.1.7 lib/jfoundry/signer.rb
jfoundry-0.1.6 lib/jfoundry/signer.rb
jfoundry-0.1.4 lib/jfoundry/signer.rb
jfoundry-0.1.3 lib/jfoundry/signer.rb
jfoundry-0.1.2 lib/jfoundry/signer.rb
jfoundry-0.1.1 lib/jfoundry/signer.rb
jfoundry-0.1.0.pre lib/jfoundry/signer.rb
jfoundry-0.1.0 lib/jfoundry/signer.rb