You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some use cases that aren't met by current hashing functions
Serialize state of a partial byte stream processing for later work; recalculating the hash from the beginning is inefficient and, in our case, infeasible due to the size of the data and legacy compatibility requirements that inhibit use of, say, a Merkle tree.
Sharing calculation of common prefix hashes; this only requires in-memory copying rather than serialization.
Conditional append based on hash matches, which is a corollary of the previous.
We can't change the signature of e.g. https://golang.org/pkg/crypto/md5/#New but we could document in an Example that you can type-assert that the returned hash.Hash is also an encoding.BinaryUnmarshaler etc.
bradfitz
changed the title
FR: Serializable intermediate hash state
proposal: Serializable intermediate hash state
Jun 5, 2017
Any objections to hashes implementing BinaryMarshaler and BinaryUnmarshaler? Will leave this open for a week.
bradfitz
changed the title
proposal: Serializable intermediate hash state
proposal: hash: Serializable intermediate hash state
Jun 5, 2017
rsc
changed the title
proposal: hash: Serializable intermediate hash state
hash: allow Hash to implement encoding.BinaryMarshaler, encoding.BinaryUnmarshaler
Jun 12, 2017
There are some use cases that aren't met by current hashing functions
Previous thread on golang-dev.
In my specific case, I'm looking for MD5 [de]serialization.
/cc @jlhawn
The text was updated successfully, but these errors were encountered: