Skip to content

Rust implementation#38

Open
tarcieri wants to merge 61 commits intobenlaurie:masterfrom
tarcieri:rust
Open

Rust implementation#38
tarcieri wants to merge 61 commits intobenlaurie:masterfrom
tarcieri:rust

Conversation

@tarcieri
Copy link
Contributor

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

tarcieri added 30 commits August 8, 2016 00:49
* 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.
Instead have finish() return a digest object we can call as_ref() on
Calculate objecthashes of normalized Unicode strings
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.
objecthash_struct! and objecthash_dict_entry! macros
Support digests of dynamically sized types
Combines objecthash_dict_entry! and objecthash_struct_member!
into a single macro.
- Move all macros to macros.rs
- Remove auto-refing of macro params
- Actually test objecthash_struct!

## Macros

The `objecthash_struct!` macro is designed to simplify implementing the ObjectHash trait on structs, producing
Copy link
Contributor Author

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant