2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Updated doc.
	* src/MessageDigestHelper.h:
pull/1/head
Tatsuhiro Tsujikawa 2008-02-17 16:12:47 +00:00
parent ebd524b6a2
commit b7e841e885
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated doc.
* src/MessageDigestHelper.h:
2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> 2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use raw message digest as a token instead of its hexadecimal Use raw message digest as a token instead of its hexadecimal

View File

@ -46,16 +46,11 @@ class BinaryStream;
class MessageDigestHelper { class MessageDigestHelper {
public: public:
/** /**
* Returns message digest in hexadecimal notation. * Returns message digest in hexadecimal representation.
* Digest algorithm is specified by algo. * Digest algorithm is specified by algo.
*/ */
static std::string digest(const std::string& algo, const SharedHandle<BinaryStream>& bs, int64_t offset, int64_t length); static std::string digest(const std::string& algo, const SharedHandle<BinaryStream>& bs, int64_t offset, int64_t length);
/**
* Calculates message digest of file denoted by filename.
*/
static std::string digest(const std::string& algo, const std::string& filename);
static std::string digest(const std::string& algo, const void* data, int32_t length); static std::string digest(const std::string& algo, const void* data, int32_t length);
static std::string digestString(const std::string& algo, const std::string& data) static std::string digestString(const std::string& algo, const std::string& data)
@ -63,6 +58,13 @@ public:
return digest(algo, data.c_str(), data.size()); return digest(algo, data.c_str(), data.size());
} }
/**
* Calculates message digest of file denoted by filename.
* Returns message digest in hexadecimal representation.
* Digest algorithm is specified by algo.
*/
static std::string digest(const std::string& algo, const std::string& filename);
/** /**
* Stores *raw* message digest into md. * Stores *raw* message digest into md.
* Throws exception when mdLength is less than the size of message digest. * Throws exception when mdLength is less than the size of message digest.