Function cmb_random_hwseed

Function Documentation

uint64_t cmb_random_hwseed(void)

Get a suitable 64-bit seed from a hardware entropy source.

It will use the best available entropy source on the current hardware, such as the RDSEED or RDRAND CPU instruction. If no suitable hardware entropy source is available, this function will do a mashup of clock time and CPU cycle count to get a suitably random seed value.

Returns:

A random 64-bit value from the best available entropy source of the current CPU hardware.