Help add wasm-bindgen support to Rand
If you like to experiment with wasm-bindgen, some help to add proper support for it in the Rand crate would be great!
A description of the issue is in https://github.com/rust-lang-nursery/rand/issues/478#issuecomment-392506170. Currently we only support wasm-unknown-unknown via stdweb, and it would be nice to have a similar implementation with wasm-bindgen.
Posted May 28, 2018, 7:40 PM UTC
An implementation exists for thread_rng's functionality: https://github.com/alexcrichton/wbg-rand
Good link, didn't know it existed (but could have assumed). I should point out that it is using Math.random for seeding, which is not secure. What Rand wants to use, and already uses with the
stdwebfeature, areCrypto.getRandomValuesin browsers andcrypto.randomBytesin Node.js.