I think the two problems should be separated.  MyTuple -> ByteString should have the properties that the encoding is stable and 1:1.  ByteString -> MyTuple should have the property that old data is readable, but it does not need to be 1:1.

So any library that supports backwards compatibility can be used for the ByteString -> MyTuple conversion, including SafeCopy.  If SafeCopy implements a new, faster encoding, that does not affect this conversion.

For a key/value store, the hash of the object can be used as key, and the SafeCopy serialization can be stored in the value together with whatever else is required.

Alexander


On Wed, Oct 8, 2014 at 12:21 AM, Kyle Marek-Spartz <kyle.marek.spartz@gmail.com> wrote:
I’m not sure hashing is what is desired due to the ByteString -> MyTuple conversion that was mentioned.


Kyle Marek-Spartz
 
 
 
 
 
On Oct 7, 2014, 4:15:55 PM, Alexander Kjeldaas <alexander.kjeldaas@gmail.com> wrote:

Assuming the Generic instance is a stable interface, I would create a traversal of that, feeding directly into a Blake2b-implementation (a fast SHA3 finalist, tweaked).


This gives you a cryptographically strong fingerprint, space usage is flexible (extract as many bytes as you want), is fast (~1GB/s), and with low complexity/external dependencies.


Alexander