Crafter.Build/wasi-runtime
catbot 08c28a46b7
All checks were successful
CI / build-test-release (pull_request) Successful in 7m50s
fix: back WASI random_get with crypto.getRandomValues
The random_get import was stubbed to return success without writing any
bytes, so every std::random_device user in wasm got all-zero
"randomness". This collided WebRTC peer ids across browser tabs in
3DForts (Catcrafts/3DForts#50).

Fill the target buffer from crypto.getRandomValues (a CSPRNG), chunking
at 65536 bytes to stay under WebCrypto's per-call quota, and add
random_get to the bind list since it now touches this.instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 00:09:08 +00:00
..
index.html.in wasm fixes 2026-05-26 22:50:08 +02:00
runtime.js fix: back WASI random_get with crypto.getRandomValues 2026-06-02 00:09:08 +00:00