traits
traits copied to clipboard
Add HashWriter and HashReader structs
Not sure if this is the right place for this, but we've found frequently needing to read or write data while simultaneously hashing the data. Based on the implementation in the phase2 crate, gated by the "std" feature.
While creating this PR I noticed this previous PR which is somewhat related, but I think a little different, and I also note the documentation describes that hashers can implement io::Write, which I think is also slightly different.
I've found myself in need for this as well, multiple times. However, I wonder whether some more generic construction like a Writer broadcasting to multiple other Writers (in a separate crate) would be a better solution here.