twox-hash
A Rust implementation of the XXHash and XXH3 algorithms
2.1.3
225M downloads/mo
#454 most downloaded on crates.io
shepmaster/twox-hash
What this package is like to depend on
Last release 1 months ago
19 Jul 2026
Release timing varies
gaps range from 2 weeks to 2.5 years
Some releases are documented
notes for 6 of 21 stable releases
2 versions withdrawn
withdrawn after publishing
11 years old
23 releases · first in 2015
2 releases in the last 12 months
see the full history below
Release timeline
23 releases · May 2015 to Jul 2026Releases
latest 23-
2.1.319 Jul 2026Release notes
Open source →Fixed
- Removed a panic that could occur when using
XxHash32orXxHash64in debug mode. Release mode is unaffected.
Changed
- The version range for the optional
randdependency now allows 0.10 in addtion to 0.9.
- Removed a panic that could occur when using
-
2.1.203 Sep 2025 -
2.1.109 Jun 2025 -
2.1.009 Dec 2024Release notes
Open source →Added
- The XXH3 128-bit algorithm is implemented via
XxHash3_128and thexxhash3_128module.
- The XXH3 128-bit algorithm is implemented via
-
2.0.104 Nov 2024Release notes
Open source →Fixed
- Removed a panic that could occur when using
XxHash3_64to hash 1 to 3 bytes of data in debug mode. Release mode and different lengths of data are unaffected.
- Removed a panic that could occur when using
-
2.0.018 Oct 2024Release notes
Open source →This release is a complete rewrite of the crate, including reorganization of the code. The XXH3 algorithm now matches the 0.8 release of the reference C xxHash implementation.
Added
-
XxHash32::oneshotandXxHash64::oneshotcan perform hashing with zero allocation and generally improved performance. If you have code that creates a hasher and hashes a slice of bytes exactly once, you are strongly encouraged to use the new functions. This might look like:// Before let mut hasher = XxHash64::new(); // or XxHash32, or with seeds some_bytes.hash(&mut hasher); let hash = hasher.finish(); // After let hash = XxHash64::oneshot(some_bytes); -
There is a feature flag for each hashing implementation. It is recommended that you opt-out of the crate's default features and only select the implementations you need to improve compile speed.
Changed
-
The crates minimum supported Rust version (MSRV) is now 1.81.
-
Functional and performance comparisons are made against the reference C xxHash library version 0.8.2, which includes a stable XXH3 algorithm.
-
Support for randomly-generated hasher instances is now behind the
randomfeature flag. It was previously combined with thestdfeature flag.
Removed
-
The deprecated type aliases
XxHashandRandomXxHashBuilderhave been removed. Replace them withXxHash64andxxhash64::RandomStaterespectively. -
RandomXxHashBuilder32andRandomXxHashBuilder64are no longer available at the top-level of the crate. Replace them withxxhash32::RandomStateand ``xxhash64::RandomState` respectively. -
Xxh3Hash64andxx3::Hash64have been renamed toXxHash3_64andxxhash3_64::Hasherrespectively. -
The free functions
xxh3::hash64,xxh3::hash64_with_seed, andxxh3::hash64_with_secretare now associated functions ofxxhash3_64::Hasher:oneshot,oneshot_with_seedandoneshot_with_secret. Note that the argument order has changed. -
Support for the digest crate has been removed. The digest crate is for cryptographic hash functions and xxHash is non-cryptographic.
-
XxHash32andXxHash64no longer implementCopy. This prevents accidentally mutating a duplicate instance of the state instead of the original state.Cloneis still implemented so you can make deliberate duplicates. -
The XXH3 128-bit variant is not yet re-written. Work is in progress for this.
-
We no longer provide support for randomly-generated instances of the XXH3 64-bit variant. The XXH3 algorithm takes both a seed and a secret as input and deciding what to randomize is non-trivial and can have negative impacts on performance.
-
-
1.6.304 May 2022Nothing published for this version
-
1.6.225 Dec 2021Nothing published for this version
-
1.6.105 Aug 2021Nothing published for this version
-
1.6.015 Oct 2020Nothing published for this version
-
1.5.005 Aug 2019Nothing published for this version
-
1.4.202 Jul 2019Nothing published for this version
-
1.4.129 Jun 2019 withdrawnNothing published for this version
-
1.4.026 Jun 2019 withdrawnNothing published for this version
-
1.3.017 May 2019Nothing published for this version
-
1.2.012 Apr 2019Nothing published for this version
-
1.1.210 Dec 2018Nothing published for this version
-
1.1.106 Jul 2018Nothing published for this version
-
1.1.019 Apr 2017Nothing published for this version
-
1.0.119 Jan 2017Nothing published for this version
-
1.0.010 Mar 2016Nothing published for this version
-
0.1.120 Jul 2015Nothing published for this version
-
0.1.009 May 2015Nothing published for this version