Created
August 23, 2022 16:17
-
-
Save vikramacharya/9735a46d02d603e6d33009a137b0ae4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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