blob: ac64187cf69dc86276922e0e475d5df25789e25b [file] [log] [blame]
Joel Galenson66036a82020-07-07 13:29:38 -07001[package]
2name = "rand"
3version = "0.7.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://rust-random.github.io/rand/"
9homepage = "https://crates.io/crates/rand"
10description = """
11Random number generators and other randomness functionality.
12"""
13keywords = ["random", "rng"]
14categories = ["algorithms", "no-std"]
15exclude = ["/utils/*", "/.travis.yml", "/appveyor.yml", ".gitignore"]
16autobenches = true
17edition = "2018"
18
19[badges]
20travis-ci = { repository = "rust-random/rand" }
21appveyor = { repository = "rust-random/rand" }
22
23[features]
24# Meta-features:
25default = ["std"] # without "std" rand uses libcore
26nightly = ["simd_support"] # enables all features requiring nightly rust
27serde1 = [] # does nothing, deprecated
28
29# Optional dependencies:
30std = ["rand_core/std", "rand_chacha/std", "alloc", "getrandom", "libc"]
31alloc = ["rand_core/alloc"] # enables Vec and Box support (without std)
32# re-export optional WASM dependencies to avoid breakage:
33# Warning: wasm-bindgen and stdweb features will be removed in rand 0.8;
34# recommended to activate via the getrandom crate instead.
35wasm-bindgen = ["getrandom_package/wasm-bindgen"]
36stdweb = ["getrandom_package/stdweb"]
37getrandom = ["getrandom_package", "rand_core/getrandom"]
38
39# Configuration:
40simd_support = ["packed_simd"] # enables SIMD support
41small_rng = ["rand_pcg"] # enables SmallRng
42
43[workspace]
44members = [
45 "rand_core",
46 "rand_distr",
47 "rand_chacha",
48 "rand_hc",
49 "rand_pcg",
50 "tests/wasm_bindgen",
51]
52
53[dependencies]
54rand_core = { path = "rand_core", version = "0.5.1" }
55rand_pcg = { path = "rand_pcg", version = "0.2", optional = true }
56# Do not depend on 'getrandom_package' directly; use the 'getrandom' feature!
57# This is a dependency because: we forward wasm feature flags
58# This is renamed because: we need getrandom to depend on rand_core/getrandom
59getrandom_package = { version = "0.1.1", package = "getrandom", optional = true }
60log = { version = "0.4.4", optional = true }
61
62[dependencies.packed_simd]
63# NOTE: so far no version works reliably due to dependence on unstable features
64version = "0.3"
65# git = "https://github.com/rust-lang-nursery/packed_simd"
66optional = true
67features = ["into_bits"]
68
69[target.'cfg(unix)'.dependencies]
70# Used for fork protection (reseeding.rs)
71libc = { version = "0.2.22", optional = true, default-features = false }
72
73# Emscripten does not support 128-bit integers, which are used by ChaCha code.
74# We work around this by using a different RNG.
75[target.'cfg(not(target_os = "emscripten"))'.dependencies]
76rand_chacha = { path = "rand_chacha", version = "0.2.1", default-features = false }
77[target.'cfg(target_os = "emscripten")'.dependencies]
78rand_hc = { path = "rand_hc", version = "0.2" }
79
80[dev-dependencies]
81rand_pcg = { path = "rand_pcg", version = "0.2" }
82# Only for benches:
83rand_hc = { path = "rand_hc", version = "0.2" }
84
85[package.metadata.docs.rs]
86all-features = true