Old fashion design for PC-104
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.

41 lines
926 B

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 17/10/2001
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: CRC.H
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of CRC.H
  13. //----------------------------------------------------------------------------
  14. #ifndef __CRC__H__INCLUDED__
  15. #define __CRC__H__INCLUDED__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #define INITIAL_CRC 0xFFFF
  20. #define CRC_TABLE s_CRC16
  21. class CCRC
  22. {
  23. public:
  24. CCRC();
  25. virtual ~CCRC();
  26. public:
  27. WORD Calculate( PBYTE pData, INT nCount );
  28. WORD CalculateRev( PBYTE pData, INT nCount );
  29. private:
  30. static WORD s_CRC16[256];
  31. static WORD s_CRC16_REV[256];
  32. static WORD s_CRCCCITT[256];
  33. static WORD s_CRCCCITT_REV[256];
  34. };
  35. #endif