Skip to content

Instantly share code, notes, and snippets.

@oskin1
Last active April 10, 2019 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oskin1/704ef3fba8d40bb1e7691919bf1e9cf9 to your computer and use it in GitHub Desktop.
Save oskin1/704ef3fba8d40bb1e7691919bf1e9cf9 to your computer and use it in GitHub Desktop.
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