From: Jano Svitok Date: 2008-01-23T23:40:36+09:00 Subject: Re: What these lines of code do? On Jan 23, 2008 3:05 PM, MohsinHijazee wrote: > # What this is doing? I mean Digest.new('sha1') returns what? > digest = OpenSSL::Digest::Digest.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 http://ruby-doc.org/stdlib/libdoc/openssl/rdoc/index.html http://ruby-doc.org/core/classes/String.html