Module rng

Module rng 

Source
Expand description

Random number generation implementations for different target environments.

This module provides conditional compilation for RNG implementations:

  • Browser: Uses crypto.getRandomValues() via getrandom with “js” feature
  • NEAR: Uses env::random_seed() with enhanced entropy via ChaCha20

Re-exports§

pub use browser::WasmRng as BrowserWasmRng;
pub use browser::WasmRngFromSeed as BrowserWasmRngFromSeed;
pub use browser::WasmRng;
pub use browser::WasmRngFromSeed;

Modules§

browser
Browser-specific RNG implementation using crypto.getRandomValues()

Traits§

CryptoRng
A marker trait used to indicate that an RngCore or BlockRngCore implementation is supposed to be cryptographically secure.
RngCore
The core of a random number generator.

Functions§

get_rng_implementation
Get the current default RNG implementation name