I am having trouble using cardano-serialization-lib. I am trying to calculate the datum hash from bytes using this library:
var myBytes = Buffer.from(
'b1566319045054327346e0043eed1af00eec2a63d9536f65087ca1c8'
);
const dtHash = hash_plutus_data(PlutusData.new_bytes(myBytes));
which gives me a4c44696aa4ed831f3a1c0b86e407a8c092cf680e61ed23f0e47a15b73d59c79
but when I tried to do it through cli with cardano-cli transaction hash-script-data --script-data-file $datumFile
where datumFile
is
{
"bytes": "b1566319045054327346e0043eed1af00eec2a63d9536f65087ca1"
}
I got edc92947d6f09957c3fe31c10478e6eeee7fdaec1e2cc7439633325cd9bcf13f
instead