Knyffen
c6b6329134
The process contains the fingerprinting function along with a queue representing the sliding window. This means that the user no longer needs to remember the outgoing character when streaming the text.
24 lines
500 B
C++
24 lines
500 B
C++
#ifndef PROCESSES_H
|
|
#define PROCESSES_H
|
|
|
|
#include "Rabin_fingerprint.hpp"
|
|
#include "general_library.hpp"
|
|
|
|
#include <stdint.h>
|
|
#include <queue>
|
|
|
|
class Rabin_fingerprint_process {
|
|
public:
|
|
Rabin_fingerprint_process(uint32_t irr_poly, size_t window_size_in_bits);
|
|
void stream_char(char c);
|
|
void stream_bit(bool b);
|
|
uint32_t get_fingerprint();
|
|
|
|
private:
|
|
std::queue<bool> window;
|
|
size_t window_size_in_bits;
|
|
Rabin_fingerprint phi;
|
|
};
|
|
|
|
#endif
|