Skip to main content

Module random

Module random 

Source
Expand description

Cross-platform random number generation for FEAGI evolution.

Uses platform-specific implementations:

  • Desktop/Server: rand crate (fast, native)
  • WASM/Browser: JavaScript’s crypto.getRandomValues() (Web Crypto API)

Copyright 2025 Neuraville Inc. Licensed under the Apache License, Version 2.0

Functions§

random_bytes
Fill buffer with random bytes
random_f32
Generate random f32 in range [0.0, 1.0)
random_f64
Generate random f64 in range [0.0, 1.0)
random_range
Generate random integer in range [min, max)
random_u64
Generate random u64 (useful for IDs, seeds, etc.)