chsvlib
chsv helper source code

◆ RandomizeMemory()

unsigned long long Chusov::Memory::RandomizeMemory ( unsigned long long  nSeed,
void *  pMemory,
std::size_t  cbMemory 
)
noexcept

Randomize a memory buffer.

Parameters
nSeedA seed used for deterministic random number generation.
pMemoryA pointer to a memory buffer to randomize.
cbMemoryA size of the buffer and a number of bytes to randomize.
Returns
Bytes written to the end of the buffer. If cbMemory is less than sizeof(unsigned long long), additional bytes are taken from nSeed to form the return value.

The function delegates the call to the RandomizeMemory_LE linear-congruential generator. See its description for details.

See also
RandomizeMemory_LE;
RandomizeMemory_BE.