chsvlib
chsv helper source code

◆ mirror_bits_kbo_copy()

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

Inverts bits of data keeping the byte order and stores the result to an output buffer.

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_copy, this function inverts only the current bit order within each of the bytes of pApi, but keeps the current byte order unchanged.

To invert bits of data in place, use mirror_bits_kbo_inplace or mirror_bits_kbo.

The mirror_bits_kbo function chooses whether to use mirror_bits_kbo_copy or mirror_bits_kbo_inplace.