EasyPython

SHA-256 Hash (hashlib module)

PythonCryptoSecurity

Hash a string with SHA-256 using Python's built-in `hashlib` module.

solve('hello')'2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824'

import hashlib
hashlib.sha256(data.encode('utf-8')).hexdigest()

Sample tests

Test #1Hash of "hello"
Input: ["hello"]
Output: "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
Test #2Empty string has a fixed hash
Input: [""]
Output: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
Test #3NIST test vector "abc"
Input: ["abc"]
Output: "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
Test #4Classic pangram test vector
Input: ["The quick brown fox jumps over the lazy dog"]
Output: "d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592"