MCPcopy Create free account
hub / github.com/Vanilagy/webcodecs-polyfill / readBit

Method readBit

src/misc.ts:418–426  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

416 }
417
418 private readBit() {
419 const byteIndex = Math.floor(this.pos / 8);
420 const byte = this.bytes[byteIndex] ?? 0;
421 const bitIndex = 0b111 - (this.pos & 0b111);
422 const bit = (byte & (1 << bitIndex)) >> bitIndex;
423
424 this.pos++;
425 return bit;
426 }
427
428 readBits(n: number) {
429 if (n === 1) {

Callers 1

readBitsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected