MCPcopy Index your code
hub / github.com/zxing-js/library / readCode

Method readCode

src/core/aztec/decoder/Decoder.ts:333–342  ·  view source on GitHub ↗

* Reads a code of given length and at given index in an array of bits

(rawbits: boolean[], startIndex: number, length: number)

Source from the content-addressed store, hash-verified

331 * Reads a code of given length and at given index in an array of bits
332 */
333 private static readCode(rawbits: boolean[], startIndex: number, length: number): number {
334 let res = 0;
335 for (let i = startIndex; i < startIndex + length; i++) {
336 res <<= 1;
337 if (rawbits[i]) {
338 res |= 0x01;
339 }
340 }
341 return res;
342 }
343
344 /**
345 * Reads a code of length 8 in an array of bits, padding with zeros

Callers 3

getEncodedDataMethod · 0.80
correctBitsMethod · 0.80
readByteMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected