SHA256
From:
westerkamp@...
To:
fabric@...
Date:
03/11/2020 07:05 PM
Subject:
[EXTERNAL] [Hyperledger
Fabric] #fabric
Sent by:
fabric@...
Hi everyone,
I have a question concerning the hashes that are stored when using private
collections.
I would like to compare a preimage to the stored hash. However, I wonder
how they are computed, as there is only very little information about the
specifics in the documentation.
So far, it seems to me like MD5 hashes are used (I wonder why MD5 was chosen
these days, but that's a different story). What seems odd to me is that
I retrieve different hash sizes for different values. Storing a single
string leads to a 64bit hashe while storing a marshalled json leads to
a 128bit hash value. I retrieve the hashes using the GetPrivateDataHash()
function in Go.
Could anyone please shed some light on how to compute the hash from a given
preimage?
Thanks and best regards,
Martin