Пример #1
0
 function Combine_CRC32($crc1, $crc2, $len2)
 {
     $odd[0] = 0xedb88320;
     $row = 0x1;
     for ($n = 1; $n < 32; $n++) {
         $odd[$n] = $row;
         $row <<= 0x1;
     }
     WPOnlineBackup_Functions::GF2_Matrix_Square($even, $odd);
     WPOnlineBackup_Functions::GF2_Matrix_Square($odd, $even);
     do {
         // apply zeros operator for this bit of len2
         WPOnlineBackup_Functions::GF2_Matrix_Square($even, $odd);
         if ($len2 & 0x1) {
             $crc1 = WPOnlineBackup_Functions::GF2_Matrix_Times($even, $crc1);
         }
         $len2 >>= 0x1;
         // if no more bits set, then done
         if ($len2 == 0x0) {
             break;
         }
         // another iteration of the loop with odd and even swapped
         WPOnlineBackup_Functions::GF2_Matrix_Square($odd, $even);
         if ($len2 & 0x1) {
             $crc1 = WPOnlineBackup_Functions::GF2_Matrix_Times($odd, $crc1);
         }
         $len2 >>= 0x1;
     } while ($len2 != 0x0);
     $crc1 ^= $crc2;
     return $crc1;
 }