#random #secure-random #numbers

no-std rand_core

Core random number generator traits and tools for implementation

20 releases

0.9.0-beta.1 Nov 30, 2024
0.9.0-alpha.2 Jul 29, 2024
0.9.0-alpha.1 Mar 18, 2024
0.6.4 Sep 15, 2022
0.0.1 Sep 14, 2017

#816 in Algorithms

Download history 3360394/week @ 2024-08-24 3188058/week @ 2024-08-31 3378638/week @ 2024-09-07 3087720/week @ 2024-09-14 3737017/week @ 2024-09-21 3806479/week @ 2024-09-28 4809310/week @ 2024-10-05 4524039/week @ 2024-10-12 4709702/week @ 2024-10-19 3672734/week @ 2024-10-26 3619146/week @ 2024-11-02 3633417/week @ 2024-11-09 3672567/week @ 2024-11-16 3062221/week @ 2024-11-23 3504024/week @ 2024-11-30 3666939/week @ 2024-12-07

14,546,203 downloads per month
Used in 45,292 crates (1,105 directly)

MIT/Apache

58KB
717 lines

rand_core

Test Status Latest version Book API API

Core traits and error types of the rand library, plus tools for implementing RNGs.

This crate is intended for use when implementing the core trait, RngCore; it defines the core traits to be implemented as well as several small functions to aid in their implementation and types required for error handling.

The main rand crate re-exports most items defined in this crate, along with tools to convert the integer samples generated by RngCore to many different applications (including sampling from restricted ranges, conversion to floating point, list permutations and secure initialisation of RNGs). Most users should prefer to use the main rand crate.

Links:

Functionality

The rand_core crate provides:

  • base random number generator traits
  • error-reporting types
  • functionality to aid implementation of RNGs

The traits and error types are also available via rand.

Versions

The current version is:

rand_core = "=0.9.0-beta.1"

License

rand_core is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT, and COPYRIGHT for details.

Dependencies

~0.9–9MB
~93K SLoC