Open this example in the interactive library
Source code
import hashlib
print(hashlib.sha256(b'hello').hexdigest())Sample output
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

Hash bytes with SHA-256. A self-contained example using the Python standard library.
Open this example in the interactive library
import hashlib
print(hashlib.sha256(b'hello').hexdigest())2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824