mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Use wasmMemoryInterface for rand_bytes
This commit is contained in:
Vendored
+1
-1
@@ -1352,7 +1352,7 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement) {
|
|||||||
|
|
||||||
rand: Math.random,
|
rand: Math.random,
|
||||||
rand_bytes: (ptr, len) => {
|
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)
|
crypto.getRandomValues(view)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user