Comments (5)
Oh, I just noticed that the digest::*Output
traits take self
, whereas std::hash::Hasher::finish
takes &self
. That will be a problem.
from hashes.
Hasher
is a really bad fit for crypto hash functions. See for example this comment and the following discussion.
from hashes.
One way to circumvent this in your code is to define your generic wrapper type and implement Hasher
for it:
struct MyDigest<D: Digest> {
d: D
}
impl<D: Digest> Hasher for MyDigest<D> {
// ..
}
from hashes.
I ended up using a similar solution. Perhaps we could add a method to the digest::Input
trait to accept std::hash::Hash
objects.
from hashes.
In that case I will close this issue as we currently don't have plans regarding implementing Hasher
. Take a look at this issue, in which we discuss crate for recursively hashing structs. maybe you'll find mzabaluev/digest-hash crate useful.
from hashes.
Related Issues (20)
- Blake2 method `KeyInit::new` is incorrect and not tested HOT 2
- sha-1 vs sha1 HOT 8
- docs for hasher states could use a reference to the `Digest` trait HOT 1
- sha2: Illegal instruction in windows server 2019 HOT 9
- DynDigest not stringable: The trait `LowerHex` is not implemented for `Box<[u8]>` HOT 2
- Cannot build on x86_64-unknown-uefi target HOT 10
- Hash functions not working on bare metal HOT 6
- The speed of calculating in rust seems like not as fast as in Node. HOT 2
- ring affected by CVE-2022-37454? HOT 3
- Upgrade issues from sha-1 0.9.8 to sha1 0.10.x HOT 2
- [Feature Request] SHA-3 KMAC HOT 1
- Performance issue on SHA3-Keccak256 since v0.10.7 HOT 12
- comparing after dereferencing or unsafely indexing, which is faster? HOT 1
- Blake2 parameters cannot be used without a key HOT 3
- use keccak crate in k12 HOT 2
- streebog: Use const fn to generate `SHUFFLED_LIN_TABLE`
- fix(?): some `extern` functions couldn't be found HOT 2
- `sha2` fails to build in Windows on an ARM device HOT 2
- blake2: MAC variants should not be constructable with an empty key?
- sha2: Interested in a way to save/restore internal state HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hashes.