Hacker ApprovedDepartments

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%
Each figure is one person. RecommendsCriticizes

Recommended in 4 of 13 months

  1. November 2025: recommended
  2. December 2025: recommended
  3. January 2026: not recommended
  4. February 2026: not recommended
  5. March 2026: not recommended
  6. April 2026: not recommended
  7. May 2026: recommended
  8. June 2026: not recommended
  9. July 2026: not recommended
  10. August 2026: recommended
  11. September 2026: not recommended
  12. October 2026: not recommended
  13. 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.

rand crate compared with 4 alternatives
ProductRecommendCriticizeApprovalMonthsOwnedBadge
anyhow (Rust crate)341077%5—Approved
Rayon18290%10—Approved
thiserror16867%5—Approved
rand crateThis page9375%4——
Facet (Rust reflection library)6275%4——
See all 8 Rust crates, ranked

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.”

RecommendsComment from 21 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”

“They have a whole bunch of different rngs. All rated by quality and performance.”

RecommendsComment from 21 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”

“The rand crate is my favorite example of this.”

RecommendsComment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”

“Even for something like rand, you need an xorshift and that's roughly it.”

CriticizesComment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”

“The top hundred are efficient, concise, well-maintained crates”

RecommendsComment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”

“The core packages (things like rand and regex) are pretty closely audited in practice”

RecommendsComment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”

“GNU libc still uses a terrible LCG for rand() despite the fact that much better generators exist”

CriticizesComment from 16 Jun 2026 in “Correlated randomness in Slay the Spire 2”

“A practical solution, and zero dramas as a result of having rand be part of std.”

RecommendsComment from 24 May 2026 in “Migrating from Go to Rust”

“I would use cargo and pull in the `rand` package, because I'm not an anti-dependencies ideologue.”

RecommendsComment from 17 Dec 2025 in “Rust GCC backend: Why and how”

“the Rust book uses the external rand create as a key example and it sets the tone for developers”

CriticizesComment from 6 Dec 2025 in “Patterns for Defensive Programming in Rust”

“Rust encourages that behavior. Sometimes rightly, but it does build a habit.”

MixedComment from 6 Dec 2025 in “Patterns for Defensive Programming in Rust”

“having just an unsecure rng might cause people to use it when they really shouldn't”

MixedComment from 24 Nov 2025 in “Shai-Hulud Returns: Over 300 NPM Packages Infected”

Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.