From 88adf3f7f2e9c6f1ea3c722ead41a5579b3292bf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 5 Oct 2019 08:30:00 +0200 Subject: Add sha{1,256}::empty() --- libbutl/sha1.mxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libbutl/sha1.mxx') diff --git a/libbutl/sha1.mxx b/libbutl/sha1.mxx index 26d4b59..f69ae5a 100644 --- a/libbutl/sha1.mxx +++ b/libbutl/sha1.mxx @@ -74,6 +74,11 @@ LIBBUTL_MODEXPORT namespace butl explicit sha1 (ifdstream& i): sha1 () {append (i);} + // Check if any data has been hashed. + // + bool + empty () const {return empty_;} + // Extract result. // // It can be obtained as either a 20-byte binary digest or as a 40- @@ -119,5 +124,6 @@ LIBBUTL_MODEXPORT namespace butl mutable digest_type bin_; mutable bool done_; + bool empty_; }; } -- cgit v1.1