Project

General

Profile

Actions

Feature #3022

closed

Add constructor of Digest object from std::istream&

Added by Alex Afanasyev over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Utils
Target version:
Start date:
07/08/2015
Due date:
% Done:

100%

Estimated time:

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).

Actions #1

Updated by Alex Afanasyev over 9 years ago

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.

Actions #2

Updated by Junxiao Shi over 9 years ago

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?

Actions #3

Updated by Alex Afanasyev over 9 years ago

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.

Actions #4

Updated by Junxiao Shi over 9 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF