Sha256: 8d122a6d8182212c4e3ebc815eb3b04525a65e89f00eb7efbd712dcdf8278458

Contents?: true

Size: 409 Bytes

Versions: 1

Compression:

Stored size: 409 Bytes

Contents

require 'openssl'
require 'base64'
require 'cgi/util'

module Nifcloud
  module Uri
    class Signature
      def self.v0(key, data)
        Base64.encode64(OpenSSL::HMAC.digest("sha1", key.encode("utf-8"), data.encode("utf-8"))).chomp
      end

      def self.v2(key, data)
        Base64.encode64(OpenSSL::HMAC.digest("sha256", key.encode("utf-8"), data.encode("utf-8"))).chomp
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nifcloud-uri-0.1.0 lib/nifcloud/uri/signature.rb