public function xorKey(Byte $key2) { $length = $key2->getLength(); for ($i = 0; $i < $length; $i++) { $this->byte->setOne($this->byte->getOne($i % 14)->get() ^ $key2->getOne($i)->get(), $i % 14); } return $this; }
private function checkChecksum(Byte $message) { $checksum = ""; $length = $message->getLength(); for ($i = 0; $i < $length; $i++) { $checksum ^= $message->getOne($i)->get(); } return $checksum == ""; }
public function testSetLength() { $this->byte->setLength(8); $this->assertEquals("Mateusz", $this->byte->get()); $this->assertEquals(8, $this->byte->getLength()); }