diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-05 08:30:00 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-05 08:30:00 +0200 |
commit | 88adf3f7f2e9c6f1ea3c722ead41a5579b3292bf (patch) | |
tree | 8329c7f984ea18c6cb35cc1b5ec77f1b39d8656f /libbutl/sha1.mxx | |
parent | f6675a4626267c08e53bbc20bd3dd41ac8744605 (diff) |
Add sha{1,256}::empty()
Diffstat (limited to 'libbutl/sha1.mxx')
-rw-r--r-- | libbutl/sha1.mxx | 6 |
1 files changed, 6 insertions, 0 deletions
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_; }; } |