/* */ #ifndef D_MESSAGE_DIGEST_HELPER_H #define D_MESSAGE_DIGEST_HELPER_H #include "common.h" #include #include namespace aria2 { class BinaryStream; class MessageDigest; namespace message_digest { /** * ctx must be initialized or reseted before calling this function. * Returns raw digest string, not hex digest */ std::string digest (MessageDigest* ctx, const std::shared_ptr& bs, int64_t offset, int64_t length); /** * Stores *raw* message digest into md. * Throws exception when mdLength is less than the size of message digest. */ void digest (unsigned char* md, size_t mdLength, MessageDigest* ctx, const void* data, size_t length); } // namespace message_digest } // namespace aria2 #endif // D_MESSAGE_DIGEST_HELPER_H