summaryrefslogtreecommitdiff
path: root/src/hash.h
diff options
context:
space:
mode:
authorzyp <zyp@localhost>2006-05-09 22:33:27 +0200
committerzyp <zyp@localhost>2006-05-09 22:33:27 +0200
commit0c4fc1e72770fc78d87891e5c031272fca59e409 (patch)
tree10682cb815cff09ec1e2ce9beb619c916f08616c /src/hash.h
parent373495b3a1c8ccdcfece70bac69625b6823ccec0 (diff)
[project @ zyp-20060509203327-c8c93b489da2ea46]
[project @ 27] Multihash library rewrite complete.
Diffstat (limited to 'src/hash.h')
-rw-r--r--src/hash.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/hash.h b/src/hash.h
new file mode 100644
index 0000000..d2771a5
--- /dev/null
+++ b/src/hash.h
@@ -0,0 +1,27 @@
+#ifndef _HASH_H_
+#define _HASH_H_
+
+#include <string>
+
+namespace Multihash {
+ namespace Hex {
+ std::string hex(char* bin, int length);
+ std::string hex(int bin);
+ }
+
+ class Hash {
+ private:
+ std::string digest_str;
+ Hash* next;
+ void _update(const char* data, int length);
+ protected:
+ virtual void hash_update(const char* data, int length);
+ virtual std::string hash_digest();
+ public:
+ Hash(Hash* n = 0);
+ void update(std::string data);
+ std::string digest();
+ };
+}
+
+#endif // _HASH_H_