00001
00002
00003
00004
00005
00006
00007 #pragma once
00008
00009 #include <Swiften/Base/API.h>
00010 #include <Swiften/Base/ByteArray.h>
00011 #include <Swiften/Base/SafeByteArray.h>
00012
00013 namespace Swift {
00014 struct md5_state_s;
00015
00016 class SWIFTEN_API MD5 {
00017 public:
00018 MD5();
00019 ~MD5();
00020
00021 MD5& update(const std::vector<unsigned char>& data);
00022 std::vector<unsigned char> getHash();
00023
00024 static ByteArray getHash(const ByteArray& data);
00025 static ByteArray getHash(const SafeByteArray& data);
00026 static bool isAllowedForCrypto();
00027
00028 private:
00029 md5_state_s* state;
00030 };
00031 }