| 1 |
# rand_core |
| 2 |
|
| 3 |
[](https://github.com/rust-random/rand/actions) |
| 4 |
[](https://crates.io/crates/rand_core) |
| 5 |
[](https://rust-random.github.io/book/) |
| 6 |
[](https://rust-random.github.io/rand/rand_core) |
| 7 |
[](https://docs.rs/rand_core) |
| 8 |
|
| 9 |
Core traits and error types of the [rand] library, plus tools for implementing |
| 10 |
RNGs. |
| 11 |
|
| 12 |
This crate is intended for use when implementing the core trait, `RngCore`; it |
| 13 |
defines the core traits to be implemented as well as several small functions to |
| 14 |
aid in their implementation and types required for error handling. |
| 15 |
|
| 16 |
The main [rand] crate re-exports most items defined in this crate, along with |
| 17 |
tools to convert the integer samples generated by `RngCore` to many different |
| 18 |
applications (including sampling from restricted ranges, conversion to floating |
| 19 |
point, list permutations and secure initialisation of RNGs). Most users should |
| 20 |
prefer to use the main [rand] crate. |
| 21 |
|
| 22 |
Links: |
| 23 |
|
| 24 |
- [API documentation (master)](https://rust-random.github.io/rand/rand_core) |
| 25 |
- [API documentation (docs.rs)](https://docs.rs/rand_core) |
| 26 |
- [Changelog](https://github.com/rust-random/rand/blob/master/rand_core/CHANGELOG.md) |
| 27 |
|
| 28 |
[rand]: https://crates.io/crates/rand |
| 29 |
|
| 30 |
|
| 31 |
## Functionality |
| 32 |
|
| 33 |
The `rand_core` crate provides: |
| 34 |
|
| 35 |
- base random number generator traits |
| 36 |
- error-reporting types |
| 37 |
- functionality to aid implementation of RNGs |
| 38 |
|
| 39 |
The traits and error types are also available via `rand`. |
| 40 |
|
| 41 |
## Versions |
| 42 |
|
| 43 |
The current version is: |
| 44 |
|
| 45 |
```toml |
| 46 |
rand_core = "0.9.0" |
| 47 |
``` |
| 48 |
|
| 49 |
|
| 50 |
# License |
| 51 |
|
| 52 |
`rand_core` is distributed under the terms of both the MIT license and the |
| 53 |
Apache License (Version 2.0). |
| 54 |
|
| 55 |
See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and |
| 56 |
[COPYRIGHT](COPYRIGHT) for details. |