about summary refs log tree commit diff
path: root/src/libutil/hash.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r--src/libutil/hash.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index 70604a50a342..eef01fe4d609 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -335,4 +335,13 @@ HashType parseHashType(const string & s)
 }
 
  
+string printHashType(HashType ht)
+{
+    if (ht == htMD5) return "md5";
+    else if (ht == htSHA1) return "sha1";
+    else if (ht == htSHA256) return "sha256";
+    else throw Error("cannot print unknown hash type");
+}
+
+ 
 }