proper cmake

This commit is contained in:
2023-06-04 16:10:06 +02:00
parent 13a8b4c35d
commit fdcb0cf0c4
154 changed files with 1273 additions and 1620 deletions

View File

@@ -0,0 +1,34 @@
//
// Created by Stepan Usatiuk on 26.04.2023.
//
#ifndef SEMBACKUP_BUZHASHCHUNKER_H
#define SEMBACKUP_BUZHASHCHUNKER_H
#include <streambuf>
#include "Buzhash.h"
#include "Chunker.h"
/// Chunker implementation using rolling hash
class BuzhashChunker : public Chunker {
public:
/// Constructs a BuzhashChunker
/// \copydoc Chunker::Chunker
/// \param minBytes Minimum amount of bytes in returned chunks
/// \param mask Amount of trailing zeroes in the rolling hash at which the file is cut (results in average chunk size of 2^mask bytes)
/// \param window Rolling hash window (how many of chunks last bytes are included in the hash, the default is recommended)
BuzhashChunker(std::streambuf *buf, unsigned long long minBytes, unsigned long long maxBytes, unsigned long long mask, uint32_t window = 4095);
/// \copydoc Chunker::getNext
std::pair<std::string, std::vector<char>> getNext() override;
private:
const unsigned long long window; ///< Rolling hash window
const unsigned long long minBytes;///< Minimum amount of bytes in returned chunks
const unsigned long long mask; ///< Amount of trailing zeroes in the rolling hash at which the file is cut
Buzhash buzhash; ///< Hasher instance
};
#endif//SEMBACKUP_BUZHASHCHUNKER_H