Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: define hasher traits in nomt-core hasher module and feature-gate #787

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Feb 6, 2025

This refactor moves the definition of hashing traits into nomt-core::Hasher. It also exposes a simple BinaryHash trait that can be used to implement any binary hash with our typical MSB labeling scheme.

Blake3Hash is no longer exported from the NOMT crate root, but instead the nomt_core::hasher module is re-exported.

Also adds a feature-gated sha2 hasher.

Copy link
Contributor Author

rphmeier commented Feb 6, 2025

@rphmeier rphmeier force-pushed the rh-hasher-trait-refactor branch from ce68e7e to 6cf78d9 Compare February 6, 2025 22:34
@rphmeier rphmeier force-pushed the rh-node-hasher-labeling-abstraction branch from 3d45b1e to bdc1a2d Compare February 6, 2025 22:35
@rphmeier rphmeier force-pushed the rh-hasher-trait-refactor branch 2 times, most recently from 6837243 to e1f3d23 Compare February 6, 2025 22:47
node[0] |= 0b10000000;
}

pub fn unset_msb(node: &mut Node) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing rustdoc?

Copy link
Contributor

pepyakin commented Feb 7, 2025

Merge activity

  • Feb 7, 5:25 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Feb 7, 5:26 AM EST: Graphite rebased this pull request as part of a merge.
  • Feb 7, 5:28 AM EST: A user merged this pull request with Graphite.

@pepyakin pepyakin changed the base branch from rh-node-hasher-labeling-abstraction to graphite-base/787 February 7, 2025 10:25
@pepyakin pepyakin changed the base branch from graphite-base/787 to master February 7, 2025 10:25
@pepyakin pepyakin force-pushed the rh-hasher-trait-refactor branch from e1f3d23 to 7115fc0 Compare February 7, 2025 10:26
@pepyakin pepyakin merged commit e4faae8 into master Feb 7, 2025
8 checks passed
@pepyakin pepyakin deleted the rh-hasher-trait-refactor branch February 7, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants