M
MohsinHijazee
# What this is doing? I mean Digest.new('sha1') returns what?
digest = OpenSSL:igest:igest.new('sha1')
# Is it so that we say HMAC.digest to use the SHA1 algorithm?
hmac = OpenSSL::HMAC.digest(digest, SECRET_KEY, uri)
# What the chomp method does?
signature = Base64.encode64(hmac).chomp
Asking these questions as they are not documented in the Ruby
documentation.
Regards,
Mohsin
digest = OpenSSL:igest:igest.new('sha1')
# Is it so that we say HMAC.digest to use the SHA1 algorithm?
hmac = OpenSSL::HMAC.digest(digest, SECRET_KEY, uri)
# What the chomp method does?
signature = Base64.encode64(hmac).chomp
Asking these questions as they are not documented in the Ruby
documentation.
Regards,
Mohsin