aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/hash.hh
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2020-06-12 10:09:42 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2020-06-12 10:11:16 -0500
commitb260c9ee0325d7a4c78d91e47bd6e2afbde16e28 (patch)
tree176d906367d85d75e96089ce067b776fe232eacf /src/libutil/hash.hh
parent19aa892f2064d437d32a3c12758d6a623b7ae8e5 (diff)
Add newHashAllowEmpty helper function
This replaces the copy&paste with a helper function in hash.hh.
Diffstat (limited to 'src/libutil/hash.hh')
-rw-r--r--src/libutil/hash.hh2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh
index ea9fca3e7..449cb1b86 100644
--- a/src/libutil/hash.hh
+++ b/src/libutil/hash.hh
@@ -94,6 +94,8 @@ struct Hash
}
};
+/* Helper that defaults empty hashes to the 0 hash. */
+Hash newHashAllowEmpty(std::string hashStr, HashType ht);
/* Print a hash in base-16 if it's MD5, or base-32 otherwise. */
string printHash16or32(const Hash & hash);