• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

src/H03-May-2022-13786

.cargo-checksum.jsonH A D03-May-202289 11

.gitignoreH A D28-May-201831 43

CODE_OF_CONDUCT.mdH A D28-May-20185.2 KiB4127

Cargo.tomlH A D01-Jan-1970865 2422

Cargo.toml.orig-cargoH A D28-May-2018334 1311

LICENSE-APACHEH A D28-May-201810.6 KiB202169

LICENSE-MITH A D28-May-20181,023 2421

README.mdH A D28-May-2018774 2217

README.md

1# rustc-hash
2
3A speedy hash algorithm used within rustc. The hashmap in liballoc by
4default uses SipHash which isn't quite as speedy as we want. In the
5compiler we're not really worried about DOS attempts, so we use a fast
6non-cryptographic hash.
7
8This is the same as the algorithm used by Firefox -- which is a
9homespun one not based on any widely-known algorithm -- though
10modified to produce 64-bit hash values instead of 32-bit hash
11values. It consistently out-performs an FNV-based hash within rustc
12itself -- the collision rate is similar or slightly worse than FNV,
13but the speed of the hash function itself is much higher because it
14works on up to 8 bytes at a time.
15
16## Usage
17
18```
19use rustc_hash::FxHashMap;
20let map: FxHashMap<u32, u32> = FxHashMap::default();
21```
22