ctGetBit

fnuint ctGetBit(const(ubyte)[] data, size_t bitIndex) pure nothrow @nogc @safe

Extracts a bit from a byte array in constant time.

The byte array is treated as a big-endian bit sequence where bit 0 is the least significant bit of the last byte.

Parameters

dataThe byte array.
bitIndexThe index of the bit to extract (0 = LSB of last byte).

Returns

0 or 1 depending on the bit value.