We have a workers wasm that needs to generate a random number during starup. The number does not have to be secure in the crypto sense as it is only used as a random seed to our CSPRNG.
The code works locally but fails on CF workers platform where the generated seed is always 0 (zero). Further investigation shows the CF worker failing on srand (specifically time()) but not raising an exception and failing quietly. It seems to be related to 64-bit support in wasm.
We could use workers crypto api (getRandomValues) but the api is different from nodejs crypto api; we will prefer to avoid juggling this if possible. Furthermore, our random number package has siblings in Java, C, and lua where the generated sequence agree when started with the same seed in support of consistent test result.
So, what is your source of random data on the Workers platform? LavaRand does not qualify
Thank you for your help.