Last active
April 10, 2019 16:18
-
-
Save oskin1/704ef3fba8d40bb1e7691919bf1e9cf9 to your computer and use it in GitHub Desktop.
This file contains 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 hashlib | |
import secrets | |
if __name__ == '__main__': | |
secret_hex = secrets.token_bytes(32).hex() | |
h_secret = hashlib.blake2b(secret_hex.encode('utf8'), digest_size=32) | |
print('Secret: \n{}\nHashed secret: \n{}'.format(secret_hex, h_secret.hexdigest())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment