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

Function shift_bitmap_down

common/bolt11.c:539–551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537}
538
539static void shift_bitmap_down(u8 *bitmap, size_t bits)
540{
541 u8 prev = 0;
542 assert(bits < CHAR_BIT);
543
544 for (size_t i = 0; i < tal_bytelen(bitmap); i++) {
545 /* Save top bits for next one */
546 u8 v = bitmap[i];
547 bitmap[i] = (prev | (v >> bits));
548 prev = (v << (8 - bits));
549 }
550 assert(prev == 0);
551}
552
553/* BOLT #11:
554 *

Callers 1

decode_9Function · 0.85

Calls 1

tal_bytelenFunction · 0.85

Tested by

no test coverage detected