Function crc32_eth

Function Documentation

uint32_t crc32_eth(const uint8_t *buf, size_t n_bytes)

32 bit CRC according to IEEE 802.3 Ethernet standard

According to the standard, the CRC is:

  • 32 bits

  • The polynomial used to build lookup table is 0x04G11DB7,

  • Initial remainder 0xFFFFFFFF

  • 8 bit reflected input at EACH stage of the CRC calculation,

  • Final 32 bit remainder reflected and THEN XORed with 0xFFFFFFFF

Parameters:
  • buf – Buffer to compute over

  • n_bytes – # bytes in buffer

Returns:

CRC of data