mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-13 06:43:35 +00:00
Use wasmMemoryInterface for rand_bytes
This commit is contained in:
2
vendor/wasm/js/runtime.js
vendored
2
vendor/wasm/js/runtime.js
vendored
@@ -1352,7 +1352,7 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement) {
|
||||
|
||||
rand: Math.random,
|
||||
rand_bytes: (ptr, len) => {
|
||||
const view = new Uint8Array(wasm_memory.buffer, ptr, len)
|
||||
const view = new Uint8Array(wasmMemoryInterface.memory.buffer, ptr, len)
|
||||
crypto.getRandomValues(view)
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user