aboutsummaryrefslogtreecommitdiff
path: root/libbutl/sha256.mxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbutl/sha256.mxx')
-rw-r--r--libbutl/sha256.mxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbutl/sha256.mxx b/libbutl/sha256.mxx
index fca8b91..2bb58b3 100644
--- a/libbutl/sha256.mxx
+++ b/libbutl/sha256.mxx
@@ -108,6 +108,11 @@ LIBBUTL_MODEXPORT namespace butl
explicit
sha256 (ifdstream& i): sha256 () {append (i);}
+ // Check if any data has been hashed.
+ //
+ bool
+ empty () const {return empty_;}
+
// Extract result.
//
// It can be obtained as either a 32-byte binary digest or as a 64-
@@ -143,6 +148,7 @@ LIBBUTL_MODEXPORT namespace butl
mutable digest_type bin_;
mutable bool done_;
+ bool empty_;
};
// Convert a SHA256 string representation (64 hex digits) to the fingerprint