pub fn set_ahash_seed(
    new_seed: Option<[u64; 4]>
) -> Result<(), Option<[u64; 4]>>
Expand description

Set the hashing seed. This is used to hash functions etc.

This is a static global value and affects every Rhai instance. This should not be used unless you know you need it.

Warning

  • You can only call this function ONCE for the entire duration of program execution.
  • You MUST call this before performing ANY Rhai operation (e.g. creating an Engine).

Error

Returns an error containing the existing hashing seed if already set.

Example

// Set the hashing seed to [1, 2, 3, 4]
rhai::config::hashing::set_ahash_seed(Some([1, 2, 3, 4])).unwrap();

// Use Rhai AFTER setting the hashing seed
let engine = Engine::new();