-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hasher.h
38 lines (29 loc) · 856 Bytes
/
Hasher.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
#pragma once
#ifndef HASHER_H
#define HASHER_H
#include <iostream>
#include "include/sha256.h"
#include <fstream>
#include <string>
#include "include/JSON.h"
#include <QString>
#include <filesystem>
#include <system_error>
class Hasher {
public:
Hasher(std::string& directoryPath, std::string& hashStorageFile);
Hasher(const char* directoryPath, const char* hashStorageFile);
Hasher(QString directoryPath, QString hashStorageFile);
std::vector<std::string> run(const bool& dumpToFile = true);
size_t size() const;
private:
std::string dirToHash;
std::string hashFile;
suon::SUON accumulator;
std::vector<std::string> privateRun(const bool& dumpToFile);
void hashSingleFile(const std::string& fp);
suon::SUON hashDirectory(const std::string& dp);
size_t numChanges;
};
#endif