diff options
author | zyp <zyp@localhost> | 2006-05-08 14:54:40 +0200 |
---|---|---|
committer | zyp <zyp@localhost> | 2006-05-08 14:54:40 +0200 |
commit | 3a5b32f44a95b989e39273527fc924ad3d32465e (patch) | |
tree | ad977e8cdaf459f5a8b0c08f120a8ed604b5f561 /hash.h |
[project @ zyp-20060508125440-a3cc6ea65de180a0]
[project @ 23]
Seperated from disccat to a standalone project.
Diffstat (limited to 'hash.h')
-rw-r--r-- | hash.h | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -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_ |