Skip to content

Instantly share code, notes, and snippets.

@vikramacharya
Created August 23, 2022 16:17
Show Gist options
  • Select an option

  • Save vikramacharya/9735a46d02d603e6d33009a137b0ae4c to your computer and use it in GitHub Desktop.

Select an option

Save vikramacharya/9735a46d02d603e6d33009a137b0ae4c to your computer and use it in GitHub Desktop.
import nacl.encoding
import nacl.hash
def hash_message(msg: str):
HASHER = nacl.hash.blake2b
digest = HASHER(bytes(msg, 'utf-8'), digest_size=64, encoder=nacl.encoding.Base64Encoder)
digest_str = digest.decode("utf-8")
return digest_str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment