Feature #3022
closed
Add constructor of Digest object from std::istream&
Added by Alex Afanasyev over 9 years ago.
Updated over 9 years ago.
Description
Digest object should allow std::istream& as a source for digest creation.
The motivation and use case for this is chronoshare application, which needs calculate digests of files (std::istream's).
Just a little note. I was thinking to allow filename directly, but decided against this: it is either confusing (if std::string is a parameter) or requires unnecessary dependency (boost::filesystem) for the utility header file.
One implication for computing digest from std::istream
is that this operation is potential blocking, because std::istream
may be reading from a disk or NFS share.
Is this a concern?
I would say it is ok. Stream operations in general are blocking, so user already should expect non-trivial time for the operation. For the driving use case (chronoshare) there shouldn't be an issue with that.
- Status changed from Code review to Closed
Also available in: Atom
PDF