Yes, E.srand() should seed with whatever number you pass in. I wonder whether the ESP8266 port is using some ESP8266-provided rand function, and that isn't using srand?
The STM32 (in jshardware.c) tries to seed the random number generator on startup using noise from the bottom bit of the ADC while looking at (iirc) the temperature of the chip.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yes,
E.srand()
should seed with whatever number you pass in. I wonder whether the ESP8266 port is using some ESP8266-providedrand
function, and that isn't usingsrand
?The STM32 (in jshardware.c) tries to seed the random number generator on startup using noise from the bottom bit of the ADC while looking at (iirc) the temperature of the chip.