Skip to content

Support the Write trait when std feature is enabled #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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mdsteele
Copy link

Many other hash function crates (like md5 or crypto-hash) have their hash objects support the std::io::Write trait, with any write calls updating the hash with the given data. This can be very handy, allowing things like using std::io::copy() to easily hash the entire contents of an artibrary Read type without having to read all the data into memory at once.

I recently found myself wishing for this capability in the sha1 crate too, so this PR adds a Write impl for the Sha1 type (only when the "std" feature is enabled, of course).

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