chunk sending (untested)

This commit is contained in:
2023-01-16 01:21:23 +01:00
parent e1d8e9ed4c
commit 8b554bd80f
3 changed files with 173 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <array>
#include <ostream>
@@ -22,6 +23,23 @@ struct SHA1Digest {
std::ostream& operator<<(std::ostream& out, const SHA1Digest& v);
namespace std { // inject
template<> struct hash<SHA1Digest> {
std::size_t operator()(const SHA1Digest& h) const noexcept {
return
size_t(h.data[0]) << (0*8) |
size_t(h.data[1]) << (1*8) |
size_t(h.data[2]) << (2*8) |
size_t(h.data[3]) << (3*8) |
size_t(h.data[4]) << (4*8) |
size_t(h.data[5]) << (5*8) |
size_t(h.data[6]) << (6*8) |
size_t(h.data[7]) << (7*8)
;
}
};
} // std
struct FTInfoSHA1 {
std::string file_name;
uint64_t file_size {0};