Hash a string with SHA-256 using Python's built-in `hashlib` module.
solve('hello') → '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824'
solve('hello')
'2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824'
import hashlib hashlib.sha256(data.encode('utf-8')).hexdigest()
Sample tests