Advertisement
mastacore

Untitled

Dec 15th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. u32 crc(u32 *ptr, u32 size, u32 sumadr, u32 sh1, u32 sh2)
  2. {
  3.     u32 sum = 0;
  4.     sumadr /= 4;
  5.  
  6.     for (int i = 0; i < (size / 4); i++)
  7.     {
  8.         if (i == sumadr)
  9.             continue;
  10.         sum = sum ^ (ptr[i] << sh1) ^ (sum >> sh2) | 0x80;
  11.     }
  12.     return sum;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement