Skip to content

Instantly share code, notes, and snippets.

@tomellis
Created May 30, 2013 11:32
Show Gist options
  • Save tomellis/5677253 to your computer and use it in GitHub Desktop.
Save tomellis/5677253 to your computer and use it in GitHub Desktop.
import hmac
from hashlib import sha1
from time import time
path = '/v1/MossoCloudFS_XXXXXXXX/test'
redirect = 'done.html'
max_file_size = 104857600
max_file_count = 10
#expires = int(time() + 600)
expires = 1590835786
print "expires: "
print expires
key = 'mykey'
hmac_body = '%s\n%s\n%s\n%s\n%s' % (path, redirect, max_file_size, max_file_count, expires)
signature = hmac.new(key, hmac_body, sha1).hexdigest()
print "signature: "
print signature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment