|
1 | | -# rand_core |
| 1 | +# rand_core: core random number generation traits |
2 | 2 |
|
3 | | -[](https://github.com/rust-random/rand_core/actions) |
4 | | -[](https://crates.io/crates/rand_core) |
5 | | -[](https://rust-random.github.io/book/) |
6 | | -[](https://docs.rs/rand_core) |
| 3 | +<div class="badges"> |
| 4 | + |
| 5 | +[![crate][crate-badge]][crate-link] |
| 6 | +[![Docs][docs-image]][docs-link] |
| 7 | +[![Apache2/MIT licensed][license-image]][license-link] |
| 8 | +[![Build Status][build-image]][build-link] |
7 | 9 |
|
8 | | -Core traits and error types of the [rand] library, plus tools for implementing |
9 | | -RNGs. |
| 10 | +</div> |
10 | 11 |
|
11 | | -This crate is intended for use when implementing the core trait, `RngCore`; it |
12 | | -defines the core traits to be implemented as well as several small functions to |
13 | | -aid in their implementation and types required for error handling. |
| 12 | +This crate provides a collection of traits used by implementations of Random Number Generation (RNG) |
| 13 | +algorithms. Additionally, it includes helper utilities that assist with the implementation |
| 14 | +of these traits. |
14 | 15 |
|
15 | | -The main [rand] crate re-exports most items defined in this crate, along with |
16 | | -tools to convert the integer samples generated by `RngCore` to many different |
17 | | -applications (including sampling from restricted ranges, conversion to floating |
18 | | -point, list permutations and secure initialisation of RNGs). Most users should |
19 | | -prefer to use the main [rand] crate. |
| 16 | +Note that the traits focus solely on the core RNG functionality. Most users should prefer |
| 17 | +the [`rand`] crate, which offers more advanced RNG capabilities built on these core traits, |
| 18 | +such as sampling from restricted ranges, generating floating-point numbers, list permutations, |
| 19 | +and more. |
20 | 20 |
|
21 | | -Links: |
| 21 | +[`rand`]: https://docs.rs/rand |
22 | 22 |
|
23 | | -- [API documentation (docs.rs)](https://docs.rs/rand_core) |
24 | | -- [Changelog](https://github.com/rust-random/rand_core/blob/master/CHANGELOG.md) |
| 23 | +## License |
25 | 24 |
|
26 | | -[rand]: https://crates.io/crates/rand |
| 25 | +The crate is licensed under either of: |
27 | 26 |
|
| 27 | +* [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) |
| 28 | +* [MIT license](http://opensource.org/licenses/MIT) |
28 | 29 |
|
29 | | -## Functionality |
| 30 | +at your option. |
30 | 31 |
|
31 | | -The `rand_core` crate provides: |
| 32 | +[//]: # (badges) |
32 | 33 |
|
33 | | -- base random number generator traits |
34 | | -- error-reporting types |
35 | | -- functionality to aid implementation of RNGs |
36 | | - |
37 | | -The traits and error types are also available via `rand`. |
38 | | - |
39 | | -## Versions |
40 | | - |
41 | | -The current version is: |
42 | | - |
43 | | -```toml |
44 | | -rand_core = "0.9.3" |
45 | | -``` |
46 | | - |
47 | | - |
48 | | -# License |
49 | | - |
50 | | -`rand_core` is distributed under the terms of both the MIT license and the |
51 | | -Apache License (Version 2.0). |
52 | | - |
53 | | -See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and |
54 | | -[COPYRIGHT](COPYRIGHT) for details. |
| 34 | +[crate-badge]: https://img.shields.io/crates/v/rand_core.svg |
| 35 | +[crate-link]: https://crates.io/crates/rand_core |
| 36 | +[docs-image]: https://docs.rs/rand_core/badge.svg |
| 37 | +[docs-link]: https://docs.rs/rand_core |
| 38 | +[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg |
| 39 | +[build-image]: https://github.com/rust-random/rand_core/actions/workflows/test.yml/badge.svg?branch=master |
| 40 | +[license-link]: #license |
| 41 | +[build-link]: https://github.com/rust-random/rand_core/actions/workflows/test.yml?query=branch:master |
0 commit comments