From 16b63f8cdf5b488ab2f4b0e029478b01a2d6b8a8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Jul 2018 09:20:25 +0200 Subject: Add support for hashing ifdstream --- libbutl/sha1.mxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libbutl/sha1.mxx') diff --git a/libbutl/sha1.mxx b/libbutl/sha1.mxx index a3b75d7..ea4d240 100644 --- a/libbutl/sha1.mxx +++ b/libbutl/sha1.mxx @@ -28,6 +28,8 @@ import std.core; LIBBUTL_MODEXPORT namespace butl { + class ifdstream; + // SHA1 checksum calculator. // // For a single chunk of data a sum can be obtained in one line, for @@ -64,6 +66,14 @@ LIBBUTL_MODEXPORT namespace butl explicit sha1 (const char* s): sha1 () {append (s);} + // Append stream. + // + void + append (ifdstream&); + + explicit + sha1 (ifdstream& i): sha1 () {append (i);} + // Extract result. // // It can be obtained as either a 20-byte binary digest or as a 40- -- cgit v1.1