summaryrefslogtreecommitdiff
path: root/src/multihash.h
diff options
context:
space:
mode:
authorzyp <zyp@localhost>2006-05-08 15:25:19 +0200
committerzyp <zyp@localhost>2006-05-08 15:25:19 +0200
commit161978b24c8ffdc05795a1ae109fcf76ea7d20d0 (patch)
tree5d7b1d3a83f1345e1110a91bc4d2440387ceee4b /src/multihash.h
parentdf9c15d40a50ed17baa7bdbb11ef6cca9d410cf3 (diff)
[project @ zyp-20060508132519-3c461a2255e6d8d9]
[project @ 25] Adding missing files.
Diffstat (limited to 'src/multihash.h')
-rw-r--r--src/multihash.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/multihash.h b/src/multihash.h
new file mode 100644
index 0000000..5af339f
--- /dev/null
+++ b/src/multihash.h
@@ -0,0 +1,37 @@
+#ifndef _MULTIHASH_H_
+#define _MULTIHASH_H_
+
+#include <string>
+
+#include "ed2k.h"
+
+#include <openssl/md4.h>
+#include <openssl/md5.h>
+#include <openssl/sha.h>
+
+class Multihash {
+ private:
+ bool finished;
+
+ int crc32_ctx;
+ std::string crc32_str;
+
+ Ed2k ed2k_ctx;
+ std::string ed2k_str;
+
+ MD5_CTX md5_ctx;
+ std::string md5_str;
+
+ SHA_CTX sha1_ctx;
+ std::string sha1_str;
+
+ public:
+ Multihash();
+ void update(std::string data);
+ std::string crc32();
+ std::string ed2k();
+ std::string md5();
+ std::string sha1();
+};
+
+#endif // _HASH_H_