MCPcopy
hub / github.com/zpao/qrcode.react / getNumDataCodewords

Method getNumDataCodewords

src/third-party/qrcodegen/index.ts:562–566  ·  view source on GitHub ↗
(ver: int, ecl: QrCode.Ecc)

Source from the content-addressed store, hash-verified

560 // QR Code of the given version number and error correction level, with remainder bits discarded.
561 // This stateless pure function could be implemented as a (40*4)-cell lookup table.
562 private static getNumDataCodewords(ver: int, ecl: QrCode.Ecc): int {
563 return Math.floor(QrCode.getNumRawDataModules(ver) / 8) -
564 QrCode.ECC_CODEWORDS_PER_BLOCK [ecl.ordinal][ver] *
565 QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
566 }
567
568
569 // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be

Callers 2

encodeSegmentsMethod · 0.80
addEccAndInterleaveMethod · 0.80

Calls 1

getNumRawDataModulesMethod · 0.80

Tested by

no test coverage detected