----------------------------------------------------------------------
($mode, $version)
| 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) |
no outgoing calls
no test coverage detected