Sha256: 2a6dbb1bb1b240a1ddc1e85ba857811cc9db3e9c88f23bfd5bef3af36a7c9bc2

Contents?: true

Size: 404 Bytes

Versions: 2

Compression:

Stored size: 404 Bytes

Contents

module ApiAuth
  module Helpers # :nodoc:
    def b64_encode(string)
      Base64.strict_encode64(string)
    end

    def sha256_base64digest(string)
      Digest::SHA256.base64digest(string)
    end

    # Capitalizes the keys of a hash
    def capitalize_keys(hsh)
      capitalized_hash = {}
      hsh.each_pair { |k, v| capitalized_hash[k.to_s.upcase] = v }
      capitalized_hash
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
api-auth-2.5.1 lib/api_auth/helpers.rb
api-auth-2.5.0 lib/api_auth/helpers.rb