1[package] 2name = "rand" 3version = "0.8.3" 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 = "2018" 17include = ["src/", "LICENSE-*", "README.md", "CHANGELOG.md", "COPYRIGHT"] 18 19[features] 20# Meta-features: 21default = ["std", "std_rng"] 22nightly = [] # enables performance optimizations requiring nightly rust 23serde1 = ["serde"] 24 25# Option (enabled by default): without "std" rand uses libcore; this option 26# enables functionality expected to be available on a standard platform. 27std = ["rand_core/std", "rand_chacha/std", "alloc", "getrandom", "libc"] 28 29# Option: "alloc" enables support for Vec and Box when not using "std" 30alloc = ["rand_core/alloc"] 31 32# Option: use getrandom package for seeding 33getrandom = ["rand_core/getrandom"] 34 35# Option (requires nightly): experimental SIMD support 36simd_support = ["packed_simd"] 37 38# Option (enabled by default): enable StdRng 39std_rng = ["rand_chacha", "rand_hc"] 40 41# Option: enable SmallRng 42small_rng = [] 43 44[workspace] 45members = [ 46 "rand_core", 47 "rand_distr", 48 "rand_chacha", 49 "rand_hc", 50 "rand_pcg", 51] 52 53[dependencies] 54rand_core = { path = "rand_core", version = "0.6.0" } 55log = { version = "0.4.4", optional = true } 56serde = { version = "1.0.103", features = ["derive"], optional = true } 57 58[dependencies.packed_simd] 59# NOTE: so far no version works reliably due to dependence on unstable features 60package = "packed_simd_2" 61version = "0.3.4" 62optional = true 63features = ["into_bits"] 64 65[target.'cfg(unix)'.dependencies] 66# Used for fork protection (reseeding.rs) 67libc = { version = "0.2.22", optional = true, default-features = false } 68 69# Emscripten does not support 128-bit integers, which are used by ChaCha code. 70# We work around this by using a different RNG. 71[target.'cfg(not(target_os = "emscripten"))'.dependencies] 72rand_chacha = { path = "rand_chacha", version = "0.3.0", default-features = false, optional = true } 73[target.'cfg(target_os = "emscripten")'.dependencies] 74rand_hc = { path = "rand_hc", version = "0.3.0", optional = true } 75 76[dev-dependencies] 77rand_pcg = { path = "rand_pcg", version = "0.3.0" } 78# Only for benches: 79rand_hc = { path = "rand_hc", version = "0.3.0" } 80# Only to test serde1 81bincode = "1.2.1" 82 83[package.metadata.docs.rs] 84# To build locally: 85# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open 86all-features = true 87rustdoc-args = ["--cfg", "doc_cfg"] 88 89[package.metadata.playground] 90features = ["small_rng", "serde1"] 91