Skip to content

Instantly share code, notes, and snippets.

@ofelix03
Last active June 2, 2023 01:14
Show Gist options
  • Save ofelix03/bcd2621c7a7ada7900fbe56188b58048 to your computer and use it in GitHub Desktop.
Save ofelix03/bcd2621c7a7ada7900fbe56188b58048 to your computer and use it in GitHub Desktop.
import hashlib
plaintext = "hello".encode()
d = hashlib.sha256(plaintext)
# generate binary hash of "hello" string
hash = d.digest()
print(hash)
# generate human readable hash of "hello" string
hash = d.hexdigest()
print(hash)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment