getRandomValues Support
Currently wrappers cannot access the system's getRandomValues interface. We should build a plugin to support this. More research & design is needed.
Relevant links: https://docs.rs/getrandom/latest/getrandom/index.html https://docs.rs/getrandom/latest/getrandom/macro.register_custom_getrandom.html https://www.assemblyscript.org/stdlib/math.html#variants https://www.assemblyscript.org/concepts.html#special-imports https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
I think this issue is the same as #891 but in rust + as? Hence, we can close the previous one?
Ah good catch, didn't realize @Niraj-Kamdar had already created this. Will close the other one.
There is currently a WASI proposal for this functionality here: https://github.com/WebAssembly/wasi-random
Before it is released, we could expose via a plugin.
Please see closing remarks here: https://github.com/polywrap/toolchain/pull/1261#issuecomment-1252779931
We can create a Rust wrapper that uses WASI to facilitate this.