# rustc-hash

> The fast, non-cryptographic FxHasher that rustc uses, with FxHashMap and FxHashSet

Source: https://talira.ai/catalog/rustc-hash-90ymt30n
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / hashing](https://talira.ai/categories/libraries/hashing), [languages / rust](https://talira.ai/categories/languages/rust)
- Licence: Apache-2.0 OR MIT[^2]
- Pricing: Free and open source[^2]
- Pricing notes: Free and open source (Apache-2.0 or MIT).
- Free tier: yes[^2]
- Backed by: [The Rust Project](https://talira.ai/orgs/rust-project.md)

rustc-hash is the Rust project's crate for the fast, non-cryptographic hash the compiler uses. It gives FxHashMap and FxHashSet, type aliases for the standard library's collections with the Fx hasher in place of SipHash, which the standard HashMap uses by default for resistance to denial-of-service attacks. The hasher kept its FxHasher name from the Firefox algorithm it started with, but is now a polynomial hash with a wyhash-inspired compression function for strings and slices. It works without std.

## Links

- GitHub: https://github.com/rust-lang/rustc-hash
- Docs: https://docs.rs/rustc-hash

## Problems it solves

- HashMap lookups in my Rust code are slow because of the default SipHash
- a faster hasher for integer keys where denial-of-service resistance doesn't matter
- fast hash maps in a no_std Rust crate

## Features

- FxHashMap and FxHashSet type aliases
- fast non-cryptographic hasher
- no_std support with the std feature off

## Limitations

- Not resistant to hash-flooding denial-of-service attacks, unlike the standard library's SipHash default[^1]

## Trust

Overall: 0.47 out of 1.
Signals: maintenance 0.64, adoption 0.56, momentum 0.25, community 0.63, backing 0.30, extensibility 0.00.

- last commit 4 days ago
- 6 commits in the last 90 days
- 606 GitHub stars
- 36 contributors
- backed by The Rust Project

## Alternatives

- [hashbrown](https://talira.ai/catalog/hashbrown-ewttdp0d.md): SwissTable-based HashMap and HashSet for Rust, the implementation behind the standard library's
- [RustCrypto Hashes](https://talira.ai/catalog/rustcrypto-hashes-fh3q76a5.md): Collection of cryptographic hash functions written in pure Rust

## Sources

[^1]: https://github.com/rust-lang/rustc-hash/blob/main/README.md (checked 29 Nov 2026)
[^2]: https://github.com/rust-lang/rustc-hash/blob/main/Cargo.toml (checked 29 Nov 2026)
