about summary refs log tree commit diff
path: root/src/libutil/hash.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/hash.hh')
-rw-r--r--src/libutil/hash.hh19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh
index 78227fb6a31b..85eb3c1b4d7e 100644
--- a/src/libutil/hash.hh
+++ b/src/libutil/hash.hh
@@ -2,6 +2,7 @@
 #define __HASH_H
 
 #include "types.hh"
+#include "serialise.hh"
 
 
 namespace nix {
@@ -81,7 +82,23 @@ Hash compressHash(const Hash & hash, unsigned int newSize);
 /* Parse a string representing a hash type. */
 HashType parseHashType(const string & s);
 
- 
+
+typedef union Ctx;
+
+class HashSink : public Sink
+{
+private:
+    HashType ht;
+    Ctx * ctx;
+
+public:
+    HashSink(HashType ht);
+    ~HashSink();
+    virtual void operator () (const unsigned char * data, unsigned int len);
+    Hash finish();
+};
+
+
 }