(ver: int, ecl: QrCodeEcc)
| 567 | // QR Code of the given version number and error correction level, with remainder bits discarded. |
| 568 | // This stateless pure function could be implemented as a (40*4)-cell lookup table. |
| 569 | private static getNumDataCodewords(ver: int, ecl: QrCodeEcc): int { |
| 570 | return ( |
| 571 | Math.floor(QrCode.getNumRawDataModules(ver) / 8) - |
| 572 | QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal]![ver]! * |
| 573 | QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal]![ver]! |
| 574 | ); |
| 575 | } |
| 576 | |
| 577 | // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be |
| 578 | // implemented as a lookup table over all possible parameter values, instead of as an algorithm. |
no test coverage detected