Absolucy / Absolucy/nanorand-rs

cannot find function `backup_entropy` in this scope for wasm target even though source seed always provided

Offen
#33 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
251
Forks
24
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Apologies for asking a question by using an issue - I'm new to rust, and I wasn't sure how to deal with this myself.

I am wanting to reliably reproduce/shuffle vast quantities of data in wasm (yew-rs) by way of a seed provided by a server:
```rust
let mut rng = WyRand::new_seed(server_seed);
rng.shuffle(&renumber);
```
I don't think I need an additional source of entropy, since WyRand reproduces the same data for the same seed?

``` Compiling rand_core v0.6.3
error[E0425]: cannot find function `backup_entropy` in this scope
--> /home/krolaw/.cargo/registry/src/github.com-1ecc6299db9ec823/nanorand-0.6.1/src/entropy/mod.rs:51:2
|
51 | backup_entropy(out);
| ^^^^^^^^^^^^^^ not found in this scope
```
Cargo.toml entry:
```toml
nanorand = { version = "0.6.1", features = ["wyrand"] }
```
Thanks.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

The error occurs in src/entropy/mod.rs at line 51, where backup_entropy is called but not defined for WASM targets. Examine the entropy module to see which targets have the function, and check the WASM-specific code paths. Look for compile-time feature flags or conditional compilation attributes. The goal is to ensure WyRand works with a provided seed in WASM without requiring external entropy.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust, wasm
Bereich
backend, cli, tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.