public function encodeModeStructure() { try { $bs = new QRbitstream(); $bs->appendNum(4, 0x3); $bs->appendNum(4, ord($this->data[1]) - 1); $bs->appendNum(4, ord($this->data[0]) - 1); $bs->appendNum(8, ord($this->data[2])); $this->bstream = $bs; return 0; } catch (Exception $e) { return -1; } }
public function appendBytes($size, $data) { if ($size == 0) { return 0; } $b = QRbitstream::newFromBytes($size, $data); if (is_null($b)) { return -1; } $ret = $this->append($b); unset($b); return $ret; }
public function mergeBitStream() { if ($this->convertData() < 0) { return null; } $bstream = new QRbitstream(); foreach ($this->items as $item) { $ret = $bstream->append($item->bstream); if ($ret < 0) { return null; } } return $bstream; }