Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. void calculateCrc(char* hashString, DWORD& crc32)
  2. {
  3.     crc32 = 0xFFFFFFFF;
  4.     ifstream hashFile(hashString, ios::binary);
  5.     ofstream output("output.txt");
  6.  
  7.         hashFile.peek();
  8.  
  9.     while(!hashFile.eof())
  10.     {
  11.         output << hex << crc32;
  12.         output << "\n";
  13.         crc32 = (crc32 >> 8) ^ crc32Table[(crc32 &0xFF) ^ hashFile.get()];
  14.         output << hex << crc32;
  15.         output << "\n";
  16.         hashFile.peek();
  17.     }
  18.  
  19.     crc32 = ~crc32;
  20.     output << hex << crc32;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement