preventing calls to Math.random given existence (but probable unreachability) of emscripten call; added window.crypto-based impl of 0-1 float getRandom
throw"Math.random calls are disallowed (cryptonote_utils) until emscripten has support to override fallback when (!crypto) - see randomFloat_unit() or remove this in fork"
// I've produced this function to replace Math.random, which we are black-holing to prevent emscripten from ever being able to call it (not that it is)
letbuffer=newArrayBuffer(8);// A buffer with just the right size to convert to Float64
letints=newInt8Array(buffer);// View it as an Int8Array and fill it with 8 random ints
window.crypto.getRandomValues(ints);
//
// Set the sign (ints[7][7]) to 0 and the
// exponent (ints[7][6]-[6][5]) to just the right size
// (all ones except for the highest bit)
ints[7]=63;
ints[6]|=0xf0;
//
// Now view it as a Float64Array, and read the one float from it