Skip to content

Commit 67230bf

Browse files
Update encoding from ascii to utf-8
1 parent 7f043e4 commit 67230bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

articles/communication-services/tutorials/includes/hmac-header-python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Use the following code to create a method for computing your HMAC signature.
102102
```python
103103
def compute_signature(string_to_sign, secret):
104104
decoded_secret = base64.b64decode(secret)
105-
encoded_string_to_sign = string_to_sign.encode('ascii')
105+
encoded_string_to_sign = string_to_sign.encode('utf-8')
106106
hashed_bytes = hmac.digest(decoded_secret, encoded_string_to_sign, digest=hashlib.sha256)
107107
encoded_signature = base64.b64encode(hashed_bytes)
108108
signature = encoded_signature.decode('utf-8')

0 commit comments

Comments
 (0)