Generating hmac involves using "private" key. So you you need to "double encode it". In python you can achieve it using two libraries hashlib and hmac.
Source code viewer
import hashlib import hmac key = '8oe0i89o7es243t5s234' message = 'Body text for the hash.'; # Generate the hash. signature = hmac.new( key, message, hashlib.sha256 ).hexdigest()Programming Language: Python