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

Function appendBits

src/third-party/qrcodegen/index.ts:695–700  ·  view source on GitHub ↗
(val: int, len: int, bb: Array<bit>)

Source from the content-addressed store, hash-verified

693 // Appends the given number of low-order bits of the given value
694 // to the given buffer. Requires 0 <= len <= 31 and 0 <= val < 2^len.
695 function appendBits(val: int, len: int, bb: Array<bit>): void {
696 if (len < 0 || len > 31 || val >>> len != 0)
697 throw new RangeError("Value out of range");
698 for (let i = len - 1; i >= 0; i--) // Append bit by bit
699 bb.push((val >>> i) & 1);
700 }
701
702
703 // Returns true iff the i'th bit of x is set to 1.

Callers 5

encodeSegmentsMethod · 0.85
makeBytesMethod · 0.85
makeNumericMethod · 0.85
makeAlphanumericMethod · 0.85
makeEciMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…