/** * @file CRC32.h * @author apio (cloudapio.eu) * @brief CRC32 checksum calculation. * * @copyright Copyright (c) 2023, the Luna authors. * */ #pragma once #include /** * @brief A class to calculate a CRC32 checksum. */ class CRC32 { public: /** * @brief Add data to the checksum. * * @param data The data to add. * @param size The amount of bytes to add. */ void append(const u8* data, usize size); /** * @brief Calculate the final checksum. * * @return u32 The calculated checksum. */ u32 digest(); private: u32 m_checksum = 0xffffffffu; };