We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ab4f246 + 67230bf commit b010a17Copy full SHA for b010a17
articles/communication-services/tutorials/includes/hmac-header-python.md
@@ -102,7 +102,7 @@ Use the following code to create a method for computing your HMAC signature.
102
```python
103
def compute_signature(string_to_sign, secret):
104
decoded_secret = base64.b64decode(secret)
105
- encoded_string_to_sign = string_to_sign.encode('ascii')
+ encoded_string_to_sign = string_to_sign.encode('utf-8')
106
hashed_bytes = hmac.digest(decoded_secret, encoded_string_to_sign, digest=hashlib.sha256)
107
encoded_signature = base64.b64encode(hashed_bytes)
108
signature = encoded_signature.decode('utf-8')
0 commit comments