-
Notifications
You must be signed in to change notification settings - Fork 32
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
Rust implementation #38
Open
tarcieri
wants to merge
61
commits into
benlaurie:master
Choose a base branch
from
tarcieri:rust
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
* Initial ObjectHash and ObjectHasher traits * Support for calculating ObjectHashes of integers * Backend support for *ring* SHA-256 digests
For the 0.1.0 release. Unfortunately *ring* is not yet released as a crate.
This reverts commit c74ace0.
Instead have finish() return a digest object we can call as_ref() on
Remove Vec<u8> from ObjectHash trait
Calculate objecthashes of normalized Unicode strings
str support
Vec<T> support
Make objecthash-ring a default feature
This adds an optional, nonstandard extension to ObjectHash for computing hashes of binary data. By default, ObjectHash only supports Unicode strings. I would like to get these changes more widely supported in other ObjectHash implementations, but for now they're flagged as optional because they're nonstandard.
Support for hashing nested object graphs, abstracting the creation of new digest contexts into ObjectHasher.
Hasher::write -> update, update_nested
This allows us to avoid heap allocations (i.e. Vec)
Implements the ObjectHash dict format for HashMaps. Also implements ObjectHash for String.
HashMap (and String) support
objecthash_struct! and objecthash_dict_entry! macros
Support digests of dynamically sized types
Always use Digest newtype
Combines objecthash_dict_entry! and objecthash_struct_member! into a single macro.
Simplify macros
- Move all macros to macros.rs - Remove auto-refing of macro params - Actually test objecthash_struct!
Macro fixups: take 2
Clippy fixups
Closed
tarcieri
commented
Nov 24, 2017
|
||
## Macros | ||
|
||
The `objecthash_struct!` macro is designed to simplify implementing the ObjectHash trait on structs, producing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ideally this would be replaced with a procedural macro, possibly even leveraging serde visitors
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.
Imports the Rust implementation of objecthash presently at:
https://github.com/cryptosphere/objecthash-rs
This is released on crates.io:
https://crates.io/crates/objecthash