rand_core

Core random number generation traits shared across the Rust rand ecosystem

Library
Cargo
v0.1.1
14 stars
MIT OR Apache-2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
37 /100 Needs Attention
Development Activity 40
Maintenance 28
Community 28
Maturity 32
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
70 /100 Good
Architecture 76
Code Quality 78
Innovation 60
Learning Curve 65

rand_core defines the foundational traits (RngCore, SeedableRng, TryRngCore, and related helpers) used by random number generator implementations throughout the Rust ecosystem. It intentionally covers only the mechanics of generating raw random words and seeding a generator, leaving higher-level functionality — sampling distributions, ranges, and floating-point generation — to the rand crate that builds on top of it.

By factoring these traits into their own minimal, dependency-light crate, RNG algorithm implementations (from cryptographic CSPRNGs to fast non-cryptographic generators) can implement a shared interface without depending on the much larger rand crate, and consumer code can accept any conforming RNG generically. With 1.4B+ total downloads, it is one of the most depended-upon crates in the Rust ecosystem.

What You Get

  • RngCore trait defining the core next_u32/next_u64/fill_bytes generator interface
  • SeedableRng trait for constructing generators from seeds in a consistent way
  • TryRngCore/error-handling helpers for fallible entropy sources
  • A block-based generator helper module (block.rs) for RNGs that produce output in fixed-size chunks
  • no_std compatibility so RNG implementations can be used in embedded and kernel contexts

Common Use Cases

  • Implementing a new RNG algorithm (cryptographic or non-cryptographic) that needs to plug into the wider Rust rand ecosystem
  • Writing generic code that accepts impl RngCore so callers can supply any compatible generator
  • Building no_std or embedded RNG implementations without pulling in the full rand crate’s dependency surface
  • Seeding and constructing RNGs consistently across different generator implementations via SeedableRng

Under The Hood

Architecture The crate is small and trait-centric: src/lib.rs (272 lines) defines the core RngCore/TryRngCore traits, seedable_rng.rs defines SeedableRng and its seeding conventions, block.rs provides a reusable helper for RNGs that generate output in fixed-size blocks rather than word-at-a-time, and word.rs/utils.rs hold small shared helper types. Tech Stack Pure Rust, edition 2024, MSRV 1.85 (notably recent, reflecting a deliberate modernization as part of the rand ecosystem’s ongoing 0.10 development), dual-licensed MIT/Apache-2.0, with lint configuration (missing_docs, missing_debug_implementations, undocumented_unsafe_blocks) enforced at warn level to keep the trait surface well-documented. Code Quality A tests/ directory validates trait behavior independently of any concrete RNG implementation, and the crate’s lints specifically require every unsafe block to carry a safety-justification comment — a meaningful quality bar given that RNG code frequently needs unsafe for performance. API Design The crate deliberately restricts itself to only the traits needed to define “what is an RNG,” explicitly deferring sampling ranges, distributions, and floating-point generation to the downstream rand crate, which keeps its own dependency footprint minimal for algorithm-implementation crates that only need to satisfy the trait contract.

Used by 6 apps in this directory

TypeScript
54%
MIT

Anarlog

AI Assistants · Note Taking · Productivity

9,404

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
68
Dependency
Built with
TypeScript 54%
Rust 34%
Updated 4 days ago
Dart
74%
AGPL 3.0

AppFlowy

AI Assistants · Collaboration · Productivity

76,967

The open-source AI workspace that puts your data, your rules — with local LLMs, CRDT collaboration, and full self-hosting built in.

View details
66
Repo Health
81
Technical
67
Dependency
Built with
Dart 74%
Rust 24%
Updated 1 weeks ago
Rust
99%
Other

Fluree DB

Databases

469

A temporal, verifiable graph database with git-like branching, integrated vector/text/geo search, and RDF/SPARQL/JSON-LD/openCypher support — benchmarked at 10.4x faster than the next database on the full Wikidata dump.

View details
87
Repo Health
74
Technical
65
Dependency
Built with
Rust 99%
Updated 5 days ago
Rust
47%
MIT

Kuku

Note Taking

225

A local-first, open-source Markdown knowledge workspace for macOS — plain files, personal wiki and Second Brain workflows, AI-assisted diffs, and encrypted sync, built as an Obsidian alternative.

View details
52
Repo Health
67
Technical
67
Dependency
Built with
Rust 47%
TypeScript 40%
Updated 3 weeks ago
Rust
85%
Apache 2.0

OpenShell

AI Agents · Developer Tools

8,811

The safe, private runtime that lets autonomous AI agents operate in sandboxed environments governed by declarative YAML policies — blocking data exfiltration, credential leaks, and unauthorized network activity before they happen.

View details
85
Repo Health
81
Technical
68
Dependency
Built with
Rust 85%
Updated 4 days ago
Rust
77%
AGPL 3.0

Spacedrive

Collaboration · File Storage

39,041

One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.

View details
56
Repo Health
84
Technical
63
Dependency
Built with
Rust 77%
TypeScript 20%
Updated 2 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers