Closed effigies closed 1 year ago
Patch coverage: 87.41
% and project coverage change: -0.63
:warning:
Comparison is base (
426564e
) 81.77% compared to head (c9926ef
) 81.14%.:exclamation: Current head c9926ef differs from pull request most recent head cb01648. Consider uploading reports for the commit cb01648 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Subsumed by #662.
Types of changes
Summary
This is an initial proposal for how to generically hash an object. The basic scheme is to create a single hash object that accepts byte-strings, and then iterates over
bytes
representations of components of the object to be hashed.The job of each object is then not to tell how to hash itself but to provide a stable representation of itself in
bytes
that is unique. By creating generators, it is not necessary to keep the fullbytes
representation of the object in memory at any time, which will be critical if file contents are to be hashed.I propose to use
blake2b
because it achieves MD5-like speed and we can use custom digest sizes to keep digests readable. Blake2 also has a tree mode, where multiple hashes can be combined. This may be useful for computing an interface hash that is created from the hashes of all inputs, but I have not attempted to think through this yet.There is a pathological case for repeated objects:
This would be mitigated by mapping objects directly to hashes.
Closes #626.
Checklist