MCPcopy Create free account
hub / github.com/ElementsProject/lightning / shift_bitmap_down

Function shift_bitmap_down

common/bolt11.c:483–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481}
482
483static void shift_bitmap_down(u8 *bitmap, size_t bits)
484{
485 u8 prev = 0;
486 assert(bits < CHAR_BIT);
487
488 for (size_t i = 0; i < tal_bytelen(bitmap); i++) {
489 /* Save top bits for next one */
490 u8 v = bitmap[i];
491 bitmap[i] = (prev | (v >> bits));
492 prev = (v << (8 - bits));
493 }
494 assert(prev == 0);
495}
496
497/* BOLT #11:
498 *

Callers 1

decode_9Function · 0.85

Calls 1

tal_bytelenFunction · 0.85

Tested by

no test coverage detected