Skip to content

Commit df45c80

Browse files
committed
targets/wasm_exec: add runtime.getRandomData to gojs imports
1 parent 1a1506e commit df45c80

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

targets/wasm_exec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@
294294
return BigInt((timeOrigin + performance.now()) * 1e6);
295295
},
296296

297+
// func getRandomData(buf []byte)
298+
"runtime.getRandomData": (buf_ptr, buf_len) => {
299+
crypto.getRandomValues(loadSlice(buf_ptr, buf_len));
300+
},
301+
297302
// func sleepTicks(timeout int64)
298303
"runtime.sleepTicks": (timeout) => {
299304
// Do not sleep, only reactivate scheduler after the given timeout.

0 commit comments

Comments
 (0)