mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-12 14:46:03 +00:00
Each realm seeded Math.random from std's RandomState. On wasm32-unknown-unknown its keys come from stack and heap addresses, which are the same on every page load, so scripts in the web build drew the same sequence each time the page opened. The seed now comes from getrandom (crypto.getRandomValues in the browser, as crates/pdf/src/encrypt.rs already does), with RandomState kept as the fallback when it fails.
24 lines
664 B
TOML
24 lines
664 B
TOML
[package]
|
|
name = "vectorcraft-js"
|
|
description = "JavaScript for scripts: an ECMAScript 5.1 parser, and an interpreter with a garbage-collected heap and execution limits"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
chrono = { workspace = true }
|
|
unicode-general-category = "1"
|
|
# The seed of Math.random (interp.rs).
|
|
getrandom = "0.4"
|
|
|
|
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
|
|
# The browser's crypto.getRandomValues.
|
|
getrandom = { version = "0.4", features = ["wasm_js"] }
|
|
|
|
[dev-dependencies]
|
|
proptest = { workspace = true }
|