aboutsummaryrefslogtreecommitdiff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/hash.cc7
-rw-r--r--src/libutil/hash.hh3
2 files changed, 9 insertions, 1 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index eef01fe4d..bd7e33a48 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -289,6 +289,13 @@ HashSink::HashSink(HashType ht) : ht(ht)
start(ht, *ctx);
}
+HashSink::HashSink(const HashSink & h)
+{
+ ht = h.ht;
+ ctx = new Ctx;
+ *ctx = *h.ctx;
+}
+
HashSink::~HashSink()
{
delete ctx;
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh
index 062d97254..81425b234 100644
--- a/src/libutil/hash.hh
+++ b/src/libutil/hash.hh
@@ -96,6 +96,7 @@ private:
public:
HashSink(HashType ht);
+ HashSink(const HashSink & h);
~HashSink();
virtual void operator () (const unsigned char * data, unsigned int len);
Hash finish();
@@ -104,5 +105,5 @@ public:
}
-
+
#endif /* !__HASH_H */