예제 #1
0
 /**
  * CRC32
  *
  * @param   math.BigInt $key
  * @param   int $char
  * @return  math.BigInt updated checksum
  */
 protected function crc32($key, $char)
 {
     $l = new BigInt(self::$crc32[$key->bitwiseXor($char)->byteValue()]);
     return new BigInt($l->bitwiseXor($key->shiftRight(8)));
 }
예제 #2
0
 public function divisionLarge()
 {
     $a = new BigInt('1846332104484924953979619544386780054125593365543499568033685888050');
     $b = new BigInt('36486872398567981638843143228254546051651870');
     $r = new BigInt('50602640980469152653015');
     $this->assertEquals($r, $a->divide($b));
 }