Skip to content

Instantly share code, notes, and snippets.

@arthurio
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthurio/7b9bbe9ac4b9f44a32a4 to your computer and use it in GitHub Desktop.
Save arthurio/7b9bbe9ac4b9f44a32a4 to your computer and use it in GitHub Desktop.
Webhook Signature Example
import hmac
import hashlib
import simplejson
from time import time
data = {
'timestamp': time(),
'user': {
'uid': 1234
}
}
data = simplejson.dumps(data)
secret_key = 'myverysecretkey'
signature = hmac.HMAC(secret_key, data, hashlib.sha256).hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment