MCPcopy Create free account
hub / github.com/codemistic/Web-Development / estimateVersion

Method estimateVersion

text-to-qr/lib/phpqrcode/phpqrcode.php:1543–1557  ·  view source on GitHub ↗

----------------------------------------------------------------------

()

Source from the content-addressed store, hash-verified

1541
1542 //----------------------------------------------------------------------
1543 public function estimateVersion()
1544 {
1545 $version = 0;
1546 $prev = 0;
1547 do {
1548 $prev = $version;
1549 $bits = $this->estimateBitStreamSize($prev);
1550 $version = QRspec::getMinimumVersion((int)(($bits + 7) / 8), $this->level);
1551 if ($version < 0) {
1552 return -1;
1553 }
1554 } while ($version > $prev);
1555
1556 return $version;
1557 }
1558
1559 //----------------------------------------------------------------------
1560 public static function lengthOfCode($mode, $version, $bits)

Callers 1

convertDataMethod · 0.95

Calls 2

estimateBitStreamSizeMethod · 0.95
getMinimumVersionMethod · 0.45

Tested by

no test coverage detected