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

Method estimateVersion

text-to-qr/lib/phpqrcode/qrinput.php:530–544  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

528
529 //----------------------------------------------------------------------
530 public function estimateVersion()
531 {
532 $version = 0;
533 $prev = 0;
534 do {
535 $prev = $version;
536 $bits = $this->estimateBitStreamSize($prev);
537 $version = QRspec::getMinimumVersion((int)(($bits + 7) / 8), $this->level);
538 if ($version < 0) {
539 return -1;
540 }
541 } while ($version > $prev);
542
543 return $version;
544 }
545
546 //----------------------------------------------------------------------
547 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