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

Method maximumWords

text-to-qr/lib/phpqrcode/qrspec.php:152–173  ·  view source on GitHub ↗

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

($mode, $version)

Source from the content-addressed store, hash-verified

150
151 //----------------------------------------------------------------------
152 public static function maximumWords($mode, $version)
153 {
154 if($mode == QR_MODE_STRUCTURE)
155 return 3;
156
157 if($version <= 9) {
158 $l = 0;
159 } else if($version <= 26) {
160 $l = 1;
161 } else {
162 $l = 2;
163 }
164
165 $bits = self::$lengthTableBits[$mode][$l];
166 $words = (1 << $bits) - 1;
167
168 if($mode == QR_MODE_KANJI) {
169 $words *= 2; // the number of bytes is required
170 }
171
172 return $words;
173 }
174
175 // Error correction code -----------------------------------------------
176 // 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