user2631: 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

user1051: I'm pretty sure this is a known bug which the devs are aiming to fix in the next hard fork. You can see the discussion here: https://github.com/Emurgo/cardano-serialization-lib/issues/227
Does your transaction work when you submit it? If it doesn't, you should get a relevant error related to the datum which you can use to fix your transaction body.

2631: <p>I am having trouble using cardano-serialization-lib. I am trying to calculate the datum hash from bytes using this library:</p>
<pre><code>var myBytes = Buffer.from(
    'b1566319045054327346e0043eed1af00eec2a63d9536f65087ca1c8'
  );
  const dtHash = hash_plutus_data(PlutusData.new_bytes(myBytes));
</code></pre>
<p>which gives me <code>a4c44696aa4ed831f3a1c0b86e407a8c092cf680e61ed23f0e47a15b73d59c79</code>
but when I tried to do it through cli with <code>cardano-cli transaction hash-script-data --script-data-file $datumFile</code>
where <code>datumFile</code> is</p>
<pre><code>{
    &quot;bytes&quot;: &quot;b1566319045054327346e0043eed1af00eec2a63d9536f65087ca1&quot;
}
</code></pre>
<p>I got <code>edc92947d6f09957c3fe31c10478e6eeee7fdaec1e2cc7439633325cd9bcf13f</code> instead</p>
 1051: <p>I'm pretty sure this is a known bug which the devs are aiming to fix in the next hard fork. You can see the discussion here: <a href="https://github.com/Emurgo/cardano-serialization-lib/issues/227" rel="nofollow noreferrer">https://github.com/Emurgo/cardano-serialization-lib/issues/227</a></p>
<p>Does your transaction work when you submit it? If it doesn't, you should get a relevant error related to the datum which you can use to fix your transaction body.</p>
