1[package]
2name = "rand"
3version = "0.9.0"
4authors = ["The Rand Project Developers", "The Rust Project Developers"]
5license = "MIT OR Apache-2.0"
6readme = "README.md"
7repository = "https://github.com/rust-random/rand"
8documentation = "https://docs.rs/rand"
9homepage = "https://rust-random.github.io/book"
10description = """
11Random number generators and other randomness functionality.
12"""
13keywords = ["random", "rng"]
14categories = ["algorithms", "no-std"]
15autobenches = true
16edition = "2021"
17rust-version = "1.63"
18include = ["src/", "LICENSE-*", "README.md", "CHANGELOG.md", "COPYRIGHT"]
19
20[package.metadata.docs.rs]
21# To build locally:
22# RUSTDOCFLAGS="--cfg docsrs -Zunstable-options --generate-link-to-definition" cargo +nightly doc --all --all-features --no-deps --open
23all-features = true
24rustdoc-args = ["--generate-link-to-definition"]
25
26[package.metadata.playground]
27features = ["small_rng", "serde"]
28
29[features]
30# Meta-features:
31default = ["std", "std_rng", "os_rng", "small_rng", "thread_rng"]
32nightly = [] # some additions requiring nightly Rust
33serde = ["dep:serde", "rand_core/serde"]
34
35# Option (enabled by default): without "std" rand uses libcore; this option
36# enables functionality expected to be available on a standard platform.
37std = ["rand_core/std", "rand_chacha?/std", "alloc"]
38
39# Option: "alloc" enables support for Vec and Box when not using "std"
40alloc = []
41
42# Option: enable OsRng
43os_rng = ["rand_core/os_rng"]
44
45# Option (requires nightly Rust): experimental SIMD support
46simd_support = ["zerocopy/simd-nightly"]
47
48# Option (enabled by default): enable StdRng
49std_rng = ["dep:rand_chacha"]
50
51# Option: enable SmallRng
52small_rng = []
53
54# Option: enable ThreadRng and rng()
55thread_rng = ["std", "std_rng", "os_rng"]
56
57# Option: use unbiased sampling for algorithms supporting this option: Uniform distribution.
58# By default, bias affecting no more than one in 2^48 samples is accepted.
59# Note: enabling this option is expected to affect reproducibility of results.
60unbiased = []
61
62# Option: enable logging
63log = ["dep:log"]
64
65[workspace]
66members = [
67 "rand_core",
68 "rand_distr",
69 "rand_chacha",
70 "rand_pcg",
71]
72exclude = ["benches", "distr_test"]
73
74[dependencies]
75rand_core = { path = "rand_core", version = "0.9.0", default-features = false }
76log = { version = "0.4.4", optional = true }
77serde = { version = "1.0.103", features = ["derive"], optional = true }
78rand_chacha = { path = "rand_chacha", version = "0.9.0", default-features = false, optional = true }
79zerocopy = { version = "0.8.0", default-features = false, features = ["simd"] }
80
81[dev-dependencies]
82rand_pcg = { path = "rand_pcg", version = "0.9.0" }
83# Only to test serde
84bincode = "1.2.1"
85rayon = "1.7"
86