-
Notifications
You must be signed in to change notification settings - Fork 59
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
No elegent way to stream hash given a hash code #141
Comments
It is a bit confusing as both Hasher and StatefulHasher implement Default, but you are explicit about what you want Rust will give it to you. let hasher: StatefulHasher = Identity256::default(); hopefully this works for you :) |
Hi 🙂 Thank you for the answer, but this is not what I’m looking for. |
I had a look. I currently see no way of doing it with the current code. The way things currently work, you cannot return a I've one idea though. Lots of the code is generated. So perhaps we could generate a companion struct to the |
Exact!
This would be really helpful! |
When you derive a |
Hi,
In previous
multihash
version, we used to be able to compute the digest in a streamed manner usingMultihashDigest::input
and it was possible to get a boxed MultihashDigest given a multihash.I currently see no way of doing the same, which is an issue in some use cases.
For example, I need to validate a digest computed from a file. Since the file can be big, I want to use the new
StatefulHasher
trait. However, I found no way to get a trait object.Here’s my code:
If I overlooked something, please let me know!
Thank you
The text was updated successfully, but these errors were encountered: