rand crate
Ranked 4 of 8 Rust crates by recommenders
Trusted standard random number library for Rust that people treat as a core dependency. Critics say it sets habits and that its non-secure RNGs get misused.
Trusted standard random number library for Rust that people treat as a core dependency. Critics say it sets habits and that its non-secure RNGs get misused.
12 people gave an opinion
- recommend it
- 9
- criticize it
- 3
- approval share
- 75%
Recommended in 4 of 13 months
- November 2025: recommended
- December 2025: recommended
- January 2026: not recommended
- February 2026: not recommended
- March 2026: not recommended
- April 2026: not recommended
- May 2026: recommended
- June 2026: not recommended
- July 2026: not recommended
- August 2026: recommended
- September 2026: not recommended
- October 2026: not recommended
- November 2026: not recommended (month in progress)
Why it doesn’t carry the badge
- 9 people recommend itNeeds 10 or more, not met.
- 3 recommenders for every criticNeeds 2 to 1 or better, met.
- Recommended in 4 of 13 monthsNeeds 4 or more, met.
The same three rules apply to every product, and the badge can’t be bought. How the badge works
What people say about it
The reasons people give, with the number of comments that give each one. Open a reason to read what they said.
Why people recommend it
Each mark is one comment
Well audited and well maintained
“The core packages (things like rand and regex) are pretty closely audited in practice”
Comment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload” “These aren't randos, these are all de-facto first party libraries.”
Comment from 21 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload” “The top hundred are efficient, concise, well-maintained crates”
Comment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload” Accepted as a standard dependency
“I would use cargo and pull in the `rand` package, because I'm not an anti-dependencies ideologue.”
Comment from 17 Dec 2025 in “Rust GCC backend: Why and how” “A practical solution, and zero dramas as a result of having rand be part of std.”
Comment from 24 May 2026 in “Migrating from Go to Rust”
What people warn about
Each mark is one comment
Sets habits for Rust developers
“Rust encourages that behavior. Sometimes rightly, but it does build a habit.”
Comment from 6 Dec 2025 in “Patterns for Defensive Programming in Rust” “the Rust book uses the external rand create as a key example and it sets the tone for developers”
Comment from 6 Dec 2025 in “Patterns for Defensive Programming in Rust”
Other Rust crates people recommend
The four most recommended other Rust crates, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.
| Product | Recommend | Criticize | Approval | Months | Owned | Badge |
|---|---|---|---|---|---|---|
| anyhow (Rust crate) | 34 | 10 | 77% | 5 | — | Approved |
| Rayon | 18 | 2 | 90% | 10 | — | Approved |
| thiserror | 16 | 8 | 67% | 5 | — | Approved |
| rand crateThis page | 9 | 3 | 75% | 4 | — | — |
| Facet (Rust reflection library) | 6 | 2 | 75% | 4 | — | — |
What people said
All 12 comments that mention it, newest first. Each links to the original comment.
“These aren't randos, these are all de-facto first party libraries.”
“They have a whole bunch of different rngs. All rated by quality and performance.”
“The rand crate is my favorite example of this.”
“Even for something like rand, you need an xorshift and that's roughly it.”
“The top hundred are efficient, concise, well-maintained crates”
“The core packages (things like rand and regex) are pretty closely audited in practice”
“GNU libc still uses a terrible LCG for rand() despite the fact that much better generators exist”
“A practical solution, and zero dramas as a result of having rand be part of std.”
“I would use cargo and pull in the `rand` package, because I'm not an anti-dependencies ideologue.”
“the Rust book uses the external rand create as a key example and it sets the tone for developers”
“Rust encourages that behavior. Sometimes rightly, but it does build a habit.”
“having just an unsecure rng might cause people to use it when they really shouldn't”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.