STC
STC copied to clipboard
crand and crand_u64 generating same number multiple time consecutively
Hi, First of all thanks for this amazing library.
I mainly work on embedded side of things specially on ESP32 MCUs (Xtensa architecture). I needed to generate 64-bit random numbers therefore i started using crandom api for that.
But for some reason it generates the same number if i try to generate random numbers.
i tried both methods.
- csrand(time(NULL)) then crand() to generate numbers
- crand_t r = crand_init(time(NULL)) then crand_u64(&r)
both methods behave in the same way. Not sure this is something coming from the bug of ESPIDF toolchain and compiler or from the STC crandom API as well.
any suggestions or insight about what could be wrong here?