/* */ #ifndef D_CHUNK_CHECKSUM_H #define D_CHUNK_CHECKSUM_H #include "common.h" #include #include #include "SharedHandle.h" namespace aria2 { class ChunkChecksum { private: std::string algo_; std::vector checksums_; size_t checksumLength_; public: ChunkChecksum(); ChunkChecksum(const std::string& algo, const std::vector& checksums, size_t checksumLength); bool validateChunk(const std::string& actualChecksum, size_t checksumIndex) const; uint64_t getEstimatedDataLength() const; size_t countChecksum() const; const std::string& getChecksum(size_t index) const; void setChecksums(const std::vector& mds); const std::vector& getChecksums() const { return checksums_; } size_t getChecksumLength() const { return checksumLength_; } void setAlgo(const std::string& algo); const std::string& getAlgo() const { return algo_; } void setChecksumLength(size_t length) { checksumLength_ = length; } }; } // namespace aria2 #endif // D_CHUNK_CHECKSUM_H