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

Add method reset for Hasher ? #41

Closed
LuoZijun opened this issue Jan 23, 2020 · 1 comment
Closed

Add method reset for Hasher ? #41

LuoZijun opened this issue Jan 23, 2020 · 1 comment

Comments

@LuoZijun
Copy link

Will this be useful in scenarios where hash calculations are very frequent?

@oconnor663
Copy link
Member

Resetting a Hasher should be pretty much the same thing as re-initializing it with Hasher::new. The only exception I can think of would be if the assignment decides to memcpy the entire CV stack, even though most of it is uninitialized garbage bytes. That might be unnecessarily expensive, but I've never measured it myself. We might also be able to fix that by making sure the constructors are marked #[inline].

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

No branches or pull requests

2 participants