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