chsvlib
chsv helper source code

◆ mirror_bits_copy()

void Chusov::Memory::mirror_bits_copy ( void *restrict  pResult,
const void *restrict  pApi,
std::size_t  cbApi 
)
noexcept

Yields a copy of a vector with the inverse bit order.

Parameters
[out]pResultAn output buffer which receives the inverse vector. The buffer may not overlap with the input buffer pApi.
[in]pApiAn arbitrary precision integer given as a byte vector to be bit-inverted. The buffer of the vector may not overlap with pApi.
cbApiLength of pApi in bytes.

Unlike mirror_bits_kbo_copy, this function inverts both the byte order within pApi and the bit order within each of the cbApi bytes.

To perform a bit inversion in place, use mirror_bits_inplace or mirror_bits.

The mirror_bits function chooses whether to use mirror_bits_copy or mirror_bits_inplace.