PyDocs

Nav

Cryptographic Services

sha256

hashlib

function
  • sha256([data, ]*, usedforsecurity=True)
Returns a sha256 hash object; optionally initialized with a string
1 Example
>>> import hashlib
>>> m = hashlib.sha256()
>>> m.update(b"Nobody inspects")
>>> m.update(b" the spammish repetition")
>>> m.digest()
b'\x03\x1e\xdd}Ae\x15\x93\xc5\xfe\\\x00o\xa5u+7\xfd\xdf\xf7\xbcN\x84:\xa6\xaf\x0c\x95\x0fK\x94\x06'
>>> m.hexdigest()
'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'
from the Python docs
See Also
No see-alsos for hashlib/sha256
0 Notes
No notes for sha256