(ver: int)
| 542 | // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. |
| 543 | // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table. |
| 544 | private static getNumRawDataModules(ver: int): int { |
| 545 | if (ver < QrCode.MIN_VERSION || ver > QrCode.MAX_VERSION) |
| 546 | throw new RangeError("Version number out of range"); |
| 547 | let result: int = (16 * ver + 128) * ver + 64; |
| 548 | if (ver >= 2) { |
| 549 | const numAlign: int = Math.floor(ver / 7) + 2; |
| 550 | result -= (25 * numAlign - 10) * numAlign - 55; |
| 551 | if (ver >= 7) |
| 552 | result -= 36; |
| 553 | } |
| 554 | assert(208 <= result && result <= 29648); |
| 555 | return result; |
| 556 | } |
| 557 | |
| 558 | |
| 559 | // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any |
no test coverage detected