mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-13 01:21:38 -07: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_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