MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ConsumeBitLE

Function ConsumeBitLE

src/util/asmap.cpp:52–57  ·  view source on GitHub ↗

* Extract a single bit from byte array using little-endian bit ordering (LSB first). * Used for ASMap data. */

Source from the content-addressed store, hash-verified

50 * Used for ASMap data.
51 */
52inline bool ConsumeBitLE(size_t& bitpos, std::span<const std::byte> bytes) noexcept
53{
54 const bool bit = (std::to_integer<uint8_t>(bytes[bitpos / 8]) >> (bitpos % 8)) & 1;
55 ++bitpos;
56 return bit;
57}
58
59/**
60 * Extract a single bit from byte array using big-endian bit ordering (MSB first).

Callers 2

DecodeBitsFunction · 0.85
SanityCheckAsmapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected