Skip to main content

Crate urng

Crate urng 

Source
Expand description

§RNG Pack

A collection of random number generators.

This crate provides implementations of various pseudo-random number generators (PRNGs), including:

§Macros

Each generator supports generating uniform random numbers for various types (u32, u64, f32, f64) and ranges.

§C API

This crate also exports C-compatible functions for creating, using, and freeing these generators, allowing them to be used from other languages.

Modules§

bst
A weighted random selection structure using a Binary Search Tree (BST) approach.
macros
Macros for quick random number generation.
rng
A 32/64-bit random number generator trait.
rng32
Consolidated 32-bit random number generators.
rng64
Consolidated 64-bit random number generators.
rng128
Consolidated 128-bit random number generators.

Macros§

choice
next
Generates the next random value using the specified algorithm and output type.
rand
Generates a random value in the specified range using the specified algorithm and output type.
search
Randomly selects an index based on weights using a binary search approach.
wrap
Wraps a value in a Wrapping type.