24 #ifndef INC_CRC32_HPP_1ADE12B7_336B_4906_BC45_70651142A09A
25 #define INC_CRC32_HPP_1ADE12B7_336B_4906_BC45_70651142A09A
70 void reset()
override;
86 std::string
toString(
const bool hexInUpperCase =
false)
const override;
96 uint8_t*
getValue(uint8_t* buffer)
const override;
113 void update(
const uint8_t* buf,
size_t len)
override;
171 return ChecksumAlgoId::CRC32;
Add some utilities to Checksum class.
Computes the CRC-32 from a byte stream.
static constexpr ChecksumAlgoId getIdentifier()
Returns an unique identifier for the checksum algorithm.
ChecksumAlgoId getID() const override
Returns an unique identifier for the checksum or the hash algorithm.
ArrayString getAltNames() const override
Returns the alternative names of the CRC32 checksum algorithm.
CRC32()
Default constructor.
static ArrayString getAlternativeNames()
Returns the alternative names of the CRC32 checksum algorithm.
uint32_t crc32
The current CRC32 value.
static Checksum * getNewInstance()
Gets a new instance of this class.
uint32_t getUint32Value() const
Returns the CRC32 value.
std::string getName() const override
Returns the name of the checksum or the hash algorithm.
static std::string getChecksumName()
Returns the name of the checksum algorithm.
uint8_t * getValue(uint8_t *buffer) const override
Returns the CRC32 value in the first 4 bytes of the given address.
void reset() override
Resets the CRC32 to initial value.
std::string toString(const bool hexInUpperCase=false) const override
Returns the CRC32 value in a string.
static const uint32_t crc_table[256]
Table used to compute the CRC32 value.
size_t getSize() const override
Returns the minimal size to allocate in memory to store the checksum with the getValue(buffer) metho...
void update(const uint8_t *buf, size_t len) override
Updates the CRC32 with specified array of bytes.
Computes a hash from a byte stream.
Computes a checksum from a byte stream.
ChecksumAlgoId
Ids of algorithms of checksums.
std::vector< std::string > ArrayString
Array of strings.