aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrian cully <bjc@spork.org>2025-12-28 17:06:32 -0500
committerbrian cully <bjc@spork.org>2025-12-28 17:06:32 -0500
commitd485b9e2cd5429a91a57ff443a30a25522b7f7f0 (patch)
treef1c3515478a4098a6f41fc0eda5071ac619ec5c9
parentdf43e984dff819e9743992cb7b047d9d17506384 (diff)
downloadpolyring-d485b9e2cd5429a91a57ff443a30a25522b7f7f0.tar.gz
polyring-d485b9e2cd5429a91a57ff443a30a25522b7f7f0.zip
let fastrand know we're in wasm
now seeds are random!
-rw-r--r--Cargo.lock28
-rw-r--r--Cargo.toml5
2 files changed, 32 insertions, 1 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 0051145..7a7a605 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -29,6 +29,22 @@ name = "fastrand"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
+dependencies = [
+ "cfg-if",
+ "js-sys",
+ "libc",
+ "wasi",
+ "wasm-bindgen",
+]
[[package]]
name = "js-sys"
@@ -41,6 +57,12 @@ dependencies = [
]
[[package]]
+name = "libc"
+version = "0.2.178"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091"
+
+[[package]]
name = "log"
version = "0.4.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -105,6 +127,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
[[package]]
+name = "wasi"
+version = "0.11.1+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
+
+[[package]]
name = "wasm-bindgen"
version = "0.2.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 84380f9..1d6d1f4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,10 @@ crate-type = ["cdylib", "rlib"]
console_log = "1.0"
log = "0.4"
wasm-bindgen = "0.2"
-fastrand = "2.3"
+
+[dependencies.fastrand]
+features = ["js"]
+version = "2.3"
[dependencies.web-sys]
features = ["Document", "DocumentTimeline", "Element", "HtmlElement", "HtmlCanvasElement", "CanvasRenderingContext2d", "Node", "Window"]