mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 02:33:28 +00:00
wasm: add support for the crypto/rand package
This is done via wasi-libc and the WASI interface, for ease of maintenance (only one implementation for both WASI and JS/browsers).
This commit is contained in:
committed by
Ron Evans
parent
ab47cea055
commit
478c592b13
@@ -285,6 +285,10 @@
|
||||
throw 'trying to exit with code ' + code;
|
||||
}
|
||||
},
|
||||
random_get: (bufPtr, bufLen) => {
|
||||
crypto.getRandomValues(loadSlice(bufPtr, bufLen));
|
||||
return 0;
|
||||
},
|
||||
},
|
||||
env: {
|
||||
// func ticks() float64
|
||||
|
||||
Reference in New Issue
Block a user