Closed
Conversation
2007c38 to
782683a
Compare
Tentatively use the FNV64 hash function, rather than SHA2-256, to
compute the hash of a mapping record.
While FNV64 is not a _cryptographic_ hash function, this should not be
an issue for what we are doing here -- we do not, in fact, need the
cryptographic properties of SHA2-256.
So for now, the `MappingHasher` can work in two mode:
* default mode, producing a ZBase32-encoded SHA2-256 hash;
* "FNV mode" (enabled by `MappingHasher(true)`), producing a hex-encoded
FNV64 hash.
The `%{hash}` mapping formatter in SSSOM/T and the
`mapping.special(hash)` extractor in SSSOM/CLI are still hardwired to
the default. The FNV hash can be required with `%{hexhash}` and
`mapping.special(hexhash)`.
Owner
Author
|
Superseded by commit 6e1c4b5, which allows coexistence of both the SHA256-based hash and the FNV64-based hash at the same time (at least until a decision is reached on the SSSOM spec). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR tentatively enables the use of the FNV64 hash function, rather than SHA2-256, to compute the hash of a mapping record.
While FNV64 is not a cryptographic hash function, this should not be an issue for what we are doing here – we do not, in fact, need the cryptographic properties of SHA2-256.
So for now, the
MappingHashercan work in two mode:MappingHasher(true)), producing a hex-encoded FNV64 hash.The
%{hash}mapping formatter in SSSOM/T and themapping.special(hash)extractor in SSSOM/CLI are still hardwired to the default. The FNV hash can be required with%{hexhash}andmapping.special(hexhash). In both cases, this may change later.The fate of this PR will depend on what the SSSOM folks have to say about using FNV64 for computing the “standard SSSOM hash”. :)