Skip to content

Get hash content using hmac in Python

import hmac
import hashlib
import codecs

# Hash a given content using hmac.
def hash_content_using_hmac(given_content, given_password):
  return, codecs.encode(given_content), hashlib.sha256).hexdigest()

def main():
    # Hash a given content using hmac
    print(hash_content_using_hmac("Poopcode!", "pwd"))


See also  How to get the value of key in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.