Last active
September 24, 2015 03:28
-
-
Save rupakg/660831 to your computer and use it in GitHub Desktop.
SHA1
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
require 'hmac-sha1' | |
require 'digest/sha1' | |
require 'base64' | |
token="-Sat, 14 Nov 2009 09:47:53 GMT-GET-/video.xml-" | |
private_key="whatever" | |
salt=Digest::SHA1.hexdigest(token)[0..19] | |
passkey=Base64.encode64(HMAC::SHA1.digest(private_key, salt)).strip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment