Name Date Size

..25-Oct-20244 KiB

.github/workflows/H25-Oct-20244 KiB

.gitignoreH A D25-Oct-202431

BUILD.gnH A D25-Oct-2024998

Cargo.tomlH A D25-Oct-2024340

CODE_OF_CONDUCT.mdH A D25-Oct-20245.2 KiB

LICENSE-APACHEH A D25-Oct-202410.6 KiB

LICENSE-MITH A D25-Oct-20241,023

OAT.xmlH A D25-Oct-20243.9 KiB

README.mdH A D25-Oct-20241.3 KiB

README.OpenSourceH A D25-Oct-2024350

src/H25-Oct-20244 KiB

README.md

1# rustc-hash
2
3[![crates.io](https://img.shields.io/crates/v/rustc-hash.svg)](https://crates.io/crates/rustc-hash)
4[![Documentation](https://docs.rs/rustc-hash/badge.svg)](https://docs.rs/rustc-hash)
5
6A speedy hash algorithm used within rustc. The hashmap in liballoc by
7default uses SipHash which isn't quite as speedy as we want. In the
8compiler we're not really worried about DOS attempts, so we use a fast
9non-cryptographic hash.
10
11This is the same as the algorithm used by Firefox -- which is a
12homespun one not based on any widely-known algorithm -- though
13modified to produce 64-bit hash values instead of 32-bit hash
14values. It consistently out-performs an FNV-based hash within rustc
15itself -- the collision rate is similar or slightly worse than FNV,
16but the speed of the hash function itself is much higher because it
17works on up to 8 bytes at a time.
18
19## Usage
20
21```rust
22use rustc_hash::FxHashMap;
23
24let mut map: FxHashMap<u32, u32> = FxHashMap::default();
25map.insert(22, 44);
26```
27
28### `no_std`
29
30This crate can be used as a `no_std` crate by disabling the `std`
31feature, which is on by default, as follows:
32
33```toml
34rustc-hash = { version = "1.1", default-features = false }
35```
36
37In this configuration, `FxHasher` is the only export, and the
38`FxHashMap`/`FxHashSet` type aliases are omitted.
39

README.OpenSource

1[
2  {
3    "Name": "rustc-hash",
4    "License": "Apache License V2.0, MIT",
5    "License File": "LICENSE-APACHE, LICENSE-MIT",
6    "Version Number": "1.1.0",
7    "Owner": "fangting12@huawei.com",
8    "Upstream URL": "https://github.com/rust-lang/rustc-hash",
9    "Description": "A Rust library that provides a fast and secure hashing algorithm."
10  }
11]