aboutsummaryrefslogtreecommitdiff
path: root/libbutl/sha256.mxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-07-10 09:20:25 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2018-07-10 14:58:50 +0300
commit16b63f8cdf5b488ab2f4b0e029478b01a2d6b8a8 (patch)
tree78509ede9ae2652e8c82f01ec91b35eba3c3c7e4 /libbutl/sha256.mxx
parent681ca375fd5af01501a91a78214ab7a26ad67ac7 (diff)
Add support for hashing ifdstream
Diffstat (limited to 'libbutl/sha256.mxx')
-rw-r--r--libbutl/sha256.mxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/libbutl/sha256.mxx b/libbutl/sha256.mxx
index ba8eeea..c0c8a84 100644
--- a/libbutl/sha256.mxx
+++ b/libbutl/sha256.mxx
@@ -29,6 +29,8 @@ import std.core;
LIBBUTL_MODEXPORT namespace butl
{
+ class ifdstream;
+
// SHA256 checksum calculator.
//
// For a single chunk of data a sum can be obtained in one line, for
@@ -98,6 +100,14 @@ LIBBUTL_MODEXPORT namespace butl
append (&x, len);
}
+ // Append stream.
+ //
+ void
+ append (ifdstream&);
+
+ explicit
+ sha256 (ifdstream& i): sha256 () {append (i);}
+
// Extract result.
//
// It can be obtained as either a 32-byte binary digest or as a 64-