diff options
Diffstat (limited to 'Swiften/FileTransfer/IncrementalBytestreamHashCalculator.h')
-rw-r--r-- | Swiften/FileTransfer/IncrementalBytestreamHashCalculator.h | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/Swiften/FileTransfer/IncrementalBytestreamHashCalculator.h b/Swiften/FileTransfer/IncrementalBytestreamHashCalculator.h index 7b4e124..4477ec1 100644 --- a/Swiften/FileTransfer/IncrementalBytestreamHashCalculator.h +++ b/Swiften/FileTransfer/IncrementalBytestreamHashCalculator.h @@ -5,8 +5,8 @@ */ /* - * Copyright (c) 2013 Remko Tronçon - * Licensed under the GNU General Public License. + * Copyright (c) 2013-2016 Isode Limited. + * All rights reserved. * See the COPYING file for more information. */ @@ -14,30 +14,34 @@ #include <string> +#include <boost/optional.hpp> + #include <Swiften/Base/ByteArray.h> #include <Swiften/Base/SafeByteArray.h> -#include <boost/optional.hpp> namespace Swift { - class Hash; - class CryptoProvider; - - class IncrementalBytestreamHashCalculator { - public: - IncrementalBytestreamHashCalculator(bool doMD5, bool doSHA1, CryptoProvider* crypto); - ~IncrementalBytestreamHashCalculator(); - - void feedData(const ByteArray& data); - //void feedData(const SafeByteArray& data); - - std::string getSHA1String(); - std::string getMD5String(); - - private: - Hash* md5Hasher; - Hash* sha1Hasher; - boost::optional<std::string> md5Hash; - boost::optional<std::string> sha1Hash; - }; + class Hash; + class CryptoProvider; + + class IncrementalBytestreamHashCalculator { + public: + IncrementalBytestreamHashCalculator(bool doMD5, bool doSHA1, CryptoProvider* crypto); + ~IncrementalBytestreamHashCalculator(); + + void feedData(const ByteArray& data); + //void feedData(const SafeByteArray& data); + + ByteArray getSHA1Hash(); + ByteArray getMD5Hash(); + + std::string getSHA1String(); + std::string getMD5String(); + + private: + Hash* md5Hasher; + Hash* sha1Hasher; + boost::optional<ByteArray> md5Hash; + boost::optional<ByteArray> sha1Hash; + }; } |