I'm trying to get SHA256 output for hexadecimal values but only able to give string input. The Python 3 code I use is given below
from hashlib import sha256
hash = sha256(b'0x01')
hx=hash.hexdigest()
print('hx: ', hx)
What I get
hx: b51c80e50d664f281fedd07ba902a21caadc0c7e0b491ece679497391e9f84cf
What I expect
hx: 4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a
The expected output is from the online tool SHA256 Online with input type as hex.