Created
March 26, 2012 05:19
-
-
Save dkam/2203157 to your computer and use it in GitHub Desktop.
Calculate a signature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculate_sig(data, key) | |
digest = OpenSSL::Digest::Digest.new('sha1') | |
res = OpenSSL::HMAC.digest(digest, key, data) | |
sig = [res].pack('m').chomp | |
return sig | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment