kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

crc32.h (535B)


      1 #ifndef KIT_CORE_CRC32_H
      2 #define KIT_CORE_CRC32_H
      3 
      4 #include <stddef.h>
      5 #include <stdint.h>
      6 
      7 /* Streaming CRC-32 (IEEE 802.3, reflected, polynomial 0xedb88320).
      8  *
      9  * The running value uses the finalized (post-complement) convention: pass
     10  * seed 0 to begin, chain the return value across successive chunks, and the
     11  * final return is the CRC-32 of the concatenated input. A single
     12  * kit_crc32(0, data, len) therefore yields the standard CRC-32 of `data`. */
     13 uint32_t kit_crc32(uint32_t seed, const uint8_t* data, size_t len);
     14 
     15 #endif