#pragma once

#include "AbstractChecksumCalculator.h"

class CyclicRedundancyChecker : public AbstractChecksumCalculator
{
public:
    void addValue(unsigned char val) override;

    uint32_t getChecksum() const override;

    void reset() override;

private:
    void createTable();
    bool mTableComputed{false};

    uint32_t mLastValue{0xffffffffL};
    unsigned long mTable[256];
};
