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/sha256.mxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libbutl/sha256.mxx') 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- -- cgit v1.1