BitsToBytes

Pack a vector of bits into bytes, eight bits per byte, least significant bit first.

Synopsis

Declared in <merkleblock.h>

std::vector<unsigned char>
BitsToBytes(std::vector<bool> const& bits);

Return Value

The packed bytes; the final byte is zero-padded when the bit count is not a multiple of eight.

Parameters

NameDescription
bitsThe bit sequence to pack.