Skip to content

Instantly share code, notes, and snippets.

@roelds
Created September 16, 2023 06:34
Show Gist options
  • Save roelds/4e4614cbef0d1ba03eb0749df6a45257 to your computer and use it in GitHub Desktop.
Save roelds/4e4614cbef0d1ba03eb0749df6a45257 to your computer and use it in GitHub Desktop.
Various Python3 snippets
# hash checksum sha3-224
import sys
import hashlib
if sys.version_info < (3, 6):
import sha3
# initiating the "s" object to use the
# sha3_224 algorithm from the hashlib module.
s = hashlib.sha3_224()
# will output the name of the hashing algorithm currently in use.
print(s.name)
# will output the Digest-Size of the hashing algorithm being used.
print(s.digest_size)
# providing the input to the hashing algorithm.
s.update(b"GeeksforGeeks")
print(s.hexdigest())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment