Last active
February 11, 2025 13:55
-
-
Save ardzz/5287638cca46920b0e413e2264bc4f42 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 hashlib | |
import json | |
def generate_hmac(key, message): | |
return hashlib.sha256(key.encode() + message.encode()).hexdigest() | |
data = {"name": "Reky", "email": "[email protected]"} | |
data_json = json.dumps(data) | |
print("Data JSON:", data_json) | |
print("HMAC:", generate_hmac("very_secret", data_json)) |
This file contains hidden or 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
PUT /profile HTTP/1.1 | |
Host: api.reky.id | |
Content-Type: application/json | |
Date: Tue, 11 Feb 2025 12:00:00 GMT | |
Hmac: 63b840b5a5d3a4ea3c203571fa4489952aad23050056fc01391e24ef804b4c25 | |
{"name": "Reky","email": "[email protected]"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment