Source code of Windows XP (NT5)
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.

44 lines
910 B

  1. //***************************************************************************
  2. //
  3. // (c) 1999-2001 by Microsoft Corp. All Rights Reserved.
  4. //
  5. // crc64.h
  6. //
  7. // cvadai 12-Nov-1999 created
  8. //
  9. //***************************************************************************
  10. #ifndef _CRC64_H_
  11. #define _CRC64_H_
  12. #define TESTHSIZE (4 * 1024 * 1024)
  13. #define TESTHMASK (TESTHSIZE - 1)
  14. #define HINIT1 0xFAC432B1UL
  15. #define HINIT2 0x0CD5E44AUL
  16. #define POLY1 0x00600340UL
  17. #define POLY2 0x00F0D50BUL
  18. typedef unsigned int hint_t; /* we want a 32 bit unsigned integer here */
  19. typedef __int64 hash_t ;
  20. class POLARITY CRC64
  21. {
  22. public:
  23. static hash_t GenerateHashValue(const wchar_t *p);
  24. private:
  25. static void Initialize(void);
  26. static void * RMalloc(int bytes);
  27. CRC64() {};
  28. ~CRC64() {};
  29. static BOOL bInit;
  30. static hash_t CrcXor[256];
  31. static hash_t Poly[64+1];
  32. };
  33. #endif