summaryrefslogtreecommitdiff
path: root/hash/hash.h
diff options
context:
space:
mode:
authorzyp <zyp@localhost>2006-01-26 20:07:15 +0100
committerzyp <zyp@localhost>2006-01-26 20:07:15 +0100
commit21559e9f4bd58b1504cc0fda7b0dceee0c833862 (patch)
tree119240a883b5bda7e4c11f60dc39206e87b1e04f /hash/hash.h
[project @ zyp-20060126190715-557e941315671b81]
[project @ 18] Moved disccat and pyanidb to the right location. Added pyqtmpc and ophidia.
Diffstat (limited to 'hash/hash.h')
-rw-r--r--hash/hash.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/hash/hash.h b/hash/hash.h
new file mode 100644
index 0000000..3c7b9c9
--- /dev/null
+++ b/hash/hash.h
@@ -0,0 +1,37 @@
+#ifndef _HASH_H_
+#define _HASH_H_
+
+#include <string>
+
+#include "ed2k.h"
+
+#include <openssl/md4.h>
+#include <openssl/md5.h>
+#include <openssl/sha.h>
+
+class Hash {
+ 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:
+ Hash();
+ void update(std::string data);
+ std::string crc32();
+ std::string ed2k();
+ std::string md5();
+ std::string sha1();
+};
+
+#endif // _HASH_H_