Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14059663
D19508.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
645 B
Referenced Files
None
Subscribers
None
D19508.diff
View Options
diff --git a/src/docs/user/userguide/webhooks.diviner b/src/docs/user/userguide/webhooks.diviner
--- a/src/docs/user/userguide/webhooks.diviner
+++ b/src/docs/user/userguide/webhooks.diviner
@@ -66,17 +66,9 @@
To compute the SHA256 HMAC of a string in Python, do this:
```lang=python
-from subprocess import check_output
-
-signature = check_output(
- [
- "php",
- "-r",
- "echo hash_hmac('sha256', $argv[1], $argv[2]);",
- "--",
- request_body,
- hmac_key
- ])
+import hashlib
+import hmac
+signature = hmac.new(hmac_key, request_body, hashlib.sha256).hexdigest()
```
Other languages often provide similar support.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 9:02 PM (1 d, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6728816
Default Alt Text
D19508.diff (645 B)
Attached To
Mode
D19508: Improve Python HMAC example in webhook documentation
Attached
Detach File
Event Timeline
Log In to Comment