diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-07-10 09:20:25 +0200 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-07-10 14:58:50 +0300 |
commit | 16b63f8cdf5b488ab2f4b0e029478b01a2d6b8a8 (patch) | |
tree | 78509ede9ae2652e8c82f01ec91b35eba3c3c7e4 /libbutl/sha1.mxx | |
parent | 681ca375fd5af01501a91a78214ab7a26ad67ac7 (diff) |
Add support for hashing ifdstream
Diffstat (limited to 'libbutl/sha1.mxx')
-rw-r--r-- | libbutl/sha1.mxx | 10 |
1 files changed, 10 insertions, 0 deletions
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- |