Assuming your byte sequence is specified as a list of hexadecimal strings, you can do this:
In[70]:= IntegerString[Hash[ExportString[FromDigits[#, 16] & /@ {"78"}, "Byte"], "SHA256"], 16, 64]
Out[70]= "2d711642b726b04401627ca9fbac32f5c8530fb1903cc4db02258717921a4881"
Hash[ByteArray[{120}], "SHA256"]
doesn't match Hash["x", "SHA256"]
because the former hashes the Wolfram Language expression ByteArray[{120}]
, not the sequence of bytes itself. To use a sequence of decimal bytes, do this:
IntegerString[
Hash[ExportString[{120}, "Byte"],
"SHA256"], 16, 64]
Both of the above match IntegerString[Hash["x", "SHA256"], 16, 64]
.