-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataSeparator.hpp
More file actions
38 lines (22 loc) · 820 Bytes
/
Copy pathDataSeparator.hpp
File metadata and controls
38 lines (22 loc) · 820 Bytes
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
#ifndef DATASEPARATOR_HPP_INCLUDED
#define DATASEPARATOR_HPP_INCLUDED
#include <random>
#include <vector>
#include "Buffer.hpp"
struct DataContainer{
uint32_t dataLength;//mb 16 or 64??
};
class DataSeparator{
uint32_t K;
mutable mt19937 randomGenerator;
const size_t serviceInformation = sizeof(DataContainer);
const size_t serviceInformation_bits = serviceInformation * 8;
size_t effectiveSingleStorageSize;
vector<uint32_t> raw2container(const Buffer &src, size_t length) const;//src - буффер с полезной инфой
Buffer container2raw(const vector<uint32_t> &src) const;
public:
DataSeparator(const uint32_t K);
vector<vector<uint32_t>> separate(const Buffer &data) const;
Buffer restore(const vector<vector<uint32_t>> &parts) const;
};
#endif // DATASEPARATOR_HPP_INCLUDED