sha2

Pure Rust implementation of the SHA-2 hash function family (SHA-224/256/384/512) with hardware-accelerated backends.

Library
Cargo
v0.11.0
2,255stars
MIT OR Apache-2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
70/100Good
Development Activity72
Maintenance32
Community76
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
89/100Excellent
Architecture90
Code Quality92
Innovation88
Learning Curve85

sha2 is the RustCrypto project’s pure-Rust implementation of the SHA-2 family of cryptographic hash functions, covering SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, and SHA-512/256. It implements the standard digest crate traits, so it drops into any Rust codebase that already speaks the RustCrypto hashing ecosystem (HMAC, PBKDF2, signature schemes, and so on) without bespoke glue code.

The crate is no_std by default, making it usable in embedded and WebAssembly targets as well as regular server and CLI applications, and it automatically selects hardware-accelerated backends (x86 SHA-NI/AVX2, AArch64 SHA2/SHA3 extensions, experimental RISC-V Zknh) at compile time with a portable software fallback when no acceleration is available.

What You Get

  • All six SHA-2 variants: SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256
  • A unified Digest trait API shared with the rest of the RustCrypto hashing ecosystem
  • Automatic hardware-accelerated backend selection (x86 SHA-NI/AVX2, AArch64 sha2/sha3, LoongArch64 asm, WASM simd128) with a portable soft fallback
  • no_std support by default for embedded, kernel, and WebAssembly targets
  • Optional oid feature exposing ASN.1 object identifiers for each algorithm, and zeroize support for secure state wiping

Common Use Cases

  • Computing file or blob checksums and content-addressable hashes in Rust services and CLI tools
  • Deriving keys or verifying integrity as a building block inside HMAC, PBKDF2, TLS, or blockchain implementations
  • Hashing in no_std firmware or WebAssembly modules where a pure-Rust, dependency-light implementation is required
  • Interoperating with other RustCrypto crates (digest, hmac, pbkdf2, rsa) that expect the shared Digest/FixedOutput traits

Under The Hood

Architecturelib.rs defines the six public hasher types (Sha224/Sha256/Sha384/Sha512/Sha512_224/Sha512_256) via the digest::buffer_fixed! macro, wrapping two shared block-level core types in block_api.rs (Sha256VarCore, Sha512VarCore) that implement the digest crate’s UpdateCore/VariableOutputCore/BlockSizeUser traits. Compression is delegated to compress256/compress512 functions defined in sha256.rs/sha512.rs, which use cfg-if to select, at compile time, one of several backend modules under src/sha256/ and src/sha512/ (soft, x86_sha, aarch64_sha2, aarch64_sha3, x86_avx2, riscv_zknh, loongarch64_asm, wasm32_simd128); initial hash state constants live in consts.rs. Tech Stack — pure Rust, edition 2024, MSRV 1.85, no_std by default; the only mandatory dependencies are digest (0.11, the shared RustCrypto hashing-trait crate) and cfg-if, with cpufeatures pulled in on x86/x86_64/aarch64 for runtime backend detection; optional alloc, zeroize, and oid Cargo features gate extra functionality, and several accelerated backends (e.g. x86_sha.rs, sha512/soft/unroll.rs) use targeted unsafe blocks for SIMD/asm intrinsics. Code Qualitytests/mod.rs drives NIST known-answer-test vectors from tests/data through digest’s own new_test!/fixed_reset_test and hash_serialization_test! macros for all six variants, plus dedicated sha256_rand/sha512_rand tests that hash 16 MiB of pseudorandom data through the incremental API against fixed expected digests — a strong regression net across backend implementations; the crate also enforces #![warn(missing_docs, unreachable_pub)] and ships benches under benches/mod.rs. API Design — the crate exposes the same ergonomic Digest trait shared across the RustCrypto ecosystem, offering both a one-shot Sha256::digest(data) call and an incremental new()/update()/finalize() pattern with no required configuration, so getting started needs only an import and a single method call, and each of the six algorithms is reachable under one canonical, consistently named type.

Used by 45 apps in this directory

TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

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
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
Dart
74%
AGPL 3.0

AppFlowy

Productivity · Project Management · Collaboration

75,729

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
66
Dependency
Built with
Dart74%
Rust24%
Updated 1 weeks ago
Rust
86%
Other

Arroyo

Data Engineering · Analytics

5,005

A distributed stream processing engine written in Rust that lets you write SQL to run stateful, real-time computations over data streams with subsecond results.

View details
86
Repo Health
74
Technical
62
Dependency
Built with
Rust86%
Updated 1 weeks ago
TypeScript
75%
GPL 3.0

Bramble

Password Manager · Security · Authentication

315

Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.

View details
73
Repo Health
84
Technical
72
Dependency
Built with
TypeScript75%
Updated today
TypeScript
55%
Other

Cap

Team Chat · Video Conferencing

20,986

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
65
Dependency
Built with
TypeScript55%
Rust40%
Updated yesterday
Rust
95%
MIT

claw-code

AI Agents · AI Code Assistants

195,087

A Rust-built CLI agent harness for Claude AI with persistent sessions, MCP tool integration, plugin hooks, and multi-provider support — designed to run autonomous coding workflows without human babysitting.

View details
71
Repo Health
71
Technical
77
Dependency
Built with
Rust95%
Updated 3 days ago
Swift
64%
GPL 3.0

cmux

Developer Tools · AI Development

26,221

A native, Ghostty-based macOS terminal with vertical tabs, agent-aware notifications, and a scriptable browser built for running many parallel AI coding agent sessions instead of juggling tmux panes.

View details
84
Repo Health
81
Technical
72
Dependency
Built with
Swift64%
Rust14%
Updated today
Rust
52%
Apache 2.0

cocoindex

Data Engineering · AI Development

11,350

An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.

View details
87
Repo Health
85
Technical
64
Dependency
Built with
Rust52%
Python48%
Updated yesterday
C
89%
MIT

codegraph

Developer Tools · AI Code Assistants

67,011

A pre-indexed code knowledge graph that cuts AI tool calls by 58% and token costs by 16% — auto-syncing, 100% local, works with Claude Code, Cursor, Codex, and more.

View details
81
Repo Health
85
Technical
73
Dependency
Built with
C89%
Updated 1 weeks 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

Search