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

Method maximumWords

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

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

($mode, $version)

Source from the content-addressed store, hash-verified

462
463 //----------------------------------------------------------------------
464 public static function maximumWords($mode, $version)
465 {
466 if($mode == QR_MODE_STRUCTURE)
467 return 3;
468
469 if($version <= 9) {
470 $l = 0;
471 } else if($version <= 26) {
472 $l = 1;
473 } else {
474 $l = 2;
475 }
476
477 $bits = self::$lengthTableBits[$mode][$l];
478 $words = (1 << $bits) - 1;
479
480 if($mode == QR_MODE_KANJI) {
481 $words *= 2; // the number of bytes is required
482 }
483
484 return $words;
485 }
486
487 // Error correction code -----------------------------------------------
488 // Table of the error correction code (Reed-Solomon block)

Callers 2

encodeBitStreamMethod · 0.45
lengthOfCodeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected