Skip to main content

interp_rng_kind

Function interp_rng_kind 

Source
fn interp_rng_kind(
    args: &[RValue],
    named: &[(String, RValue)],
    context: &BuiltinContext<'_>,
) -> Result<RValue, RError>
Expand description

Query or set the RNG algorithm.

With no arguments, returns the name of the current RNG kind as a character vector. With a kind argument, switches to the specified algorithm.

Supported kinds:

  • "Xoshiro" (default) — fast, non-cryptographic (SmallRng / Xoshiro256++)
  • "ChaCha20" — deterministic across platforms and Rust versions

After switching the RNG kind, call set.seed() to seed the new algorithm. The switch itself does NOT re-seed — the new RNG starts from system entropy.

@param kind character string naming the RNG algorithm (optional) @return character vector with the previous RNG kind (invisibly when setting)