Leaked source code of windows server 2003
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.

27 lines
496 B

  1. #pragma once
  2. const int PART_SIZE = 20;
  3. const int MAX_PARTS = 10;
  4. class IFileHash
  5. {
  6. public:
  7. virtual __int32* getHash(TCHAR *sFileName) = 0;
  8. };
  9. class CFastFileHash :
  10. public IFileHash
  11. {
  12. private:
  13. HANDLE m_hFile;
  14. __int32 m_iFileSize;
  15. int openFile(TCHAR *sFileName);
  16. int getPart(char* pBuffer,int iPart);
  17. void doHash(__int32* piHash,char* pBuffer);
  18. public:
  19. CFastFileHash(void);
  20. ~CFastFileHash(void);
  21. __int32* getHash(TCHAR *sFileName);
  22. __int32* calcHash();
  23. };