#include "crc32.h" #include int main(void) { //-- Allocate crc_calc object and construct it struct S_Crc32 crc_calc; crc32_ctor(&crc_calc); //-- Get bytes from wherever you want, and feed them to crc_calc // (in this example, bytes are just hardcoded) crc32_byte_feed(&crc_calc, 0x01); crc32_byte_feed(&crc_calc, 0x02); crc32_byte_feed(&crc_calc, 0x03); crc32_byte_feed(&crc_calc, 0x04); //-- get crc32 value uint32_t crc_val = crc32_value_get(&crc_calc); //-- destruct crc_calc crc32_dtor(&crc_calc); }