Last active
August 29, 2015 14:04
-
-
Save arthurio/7b9bbe9ac4b9f44a32a4 to your computer and use it in GitHub Desktop.
Webhook Signature Example
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
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