Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
729 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Generic CRC functions
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CHECKSUM_CRC_H
  8. #define CHECKSUM_CRC_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. typedef unsigned int CRC32_t;
  13. void CRC32_Init( CRC32_t *pulCRC );
  14. void CRC32_ProcessBuffer( CRC32_t *pulCRC, const void *p, int len );
  15. void CRC32_Final( CRC32_t *pulCRC );
  16. CRC32_t CRC32_GetTableEntry( unsigned int slot );
  17. inline CRC32_t CRC32_ProcessSingleBuffer( const void *p, int len )
  18. {
  19. CRC32_t crc;
  20. CRC32_Init( &crc );
  21. CRC32_ProcessBuffer( &crc, p, len );
  22. CRC32_Final( &crc );
  23. return crc;
  24. }
  25. #endif // CHECKSUM_CRC_H