7zCrc.h 473 B

12345678910111213141516171819202122
  1. /* 7zCrc.h */
  2. #ifndef __7Z_CRC_H
  3. #define __7Z_CRC_H
  4. #include <stddef.h>
  5. #include "Types.h"
  6. extern UInt32 g_CrcTable[];
  7. void MY_FAST_CALL CrcGenerateTable(void);
  8. #define CRC_INIT_VAL 0xFFFFFFFF
  9. #define CRC_GET_DIGEST(crc) ((crc) ^ 0xFFFFFFFF)
  10. #define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
  11. UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size);
  12. UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size);
  13. #endif