To properly display this page you need a browser with JavaScript support.
Electronic Invoicing System API v1
Developers Guide
×
Menu
Index
Search
Search
2. Terminologies
2.4. HMAC-SHA512
2.4.1. HMAC Implementation Examples
2.4.1.4. Python
Previous page
Next page
Print version
©
Malawi Revenue Authority - ICT Research and Innovations, 2024
To properly display this page you need a browser with JavaScript support.
2.4.1.4. Python
def
compute_hmac_Sha512
(plain_text, secret_key):
hash_object = hmac.new(secret_key.encode('utf-8'), plain_text.encode('utf-8'), hashlib.sha512)
return base64.b64encode(hash_object.digest()).decode('utf-8')