• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Changelog
2
3All notable changes to this project will be documented in this file.
4
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8## [2.1.0] - 2024-12-09
9
10[2.1.0]: https://github.com/shepmaster/twox-hash/tree/v2.1.0
11
12### Added
13
14- The XXH3 128-bit algorithm is implemented via `XxHash3_128` and the
15  `xxhash3_128` module.
16
17## [2.0.1] - 2024-11-04
18
19[2.0.1]: https://github.com/shepmaster/twox-hash/tree/v2.0.1
20
21### Fixed
22
23- Removed a panic that could occur when using `XxHash3_64` to hash 1
24  to 3 bytes of data in debug mode. Release mode and different lengths
25  of data are unaffected.
26
27## [2.0.0] - 2024-10-18
28
29[2.0.0]: https://github.com/shepmaster/twox-hash/tree/v2.0.0
30
31This release is a complete rewrite of the crate, including
32reorganization of the code. The XXH3 algorithm now matches the 0.8
33release of the reference C xxHash implementation.
34
35### Added
36
37- `XxHash32::oneshot` and `XxHash64::oneshot` can perform hashing with
38  zero allocation and generally improved performance. If you have code
39  that creates a hasher and hashes a slice of bytes exactly once, you
40  are strongly encouraged to use the new functions. This might look
41  like:
42
43  ```rust
44  // Before
45  let mut hasher = XxHash64::new(); // or XxHash32, or with seeds
46  some_bytes.hash(&mut hasher);
47  let hash = hasher.finish();
48
49  // After
50  let hash = XxHash64::oneshot(some_bytes);
51  ```
52
53- There is a feature flag for each hashing implementation. It is
54  recommended that you opt-out of the crate's default features and
55  only select the implementations you need to improve compile speed.
56
57### Changed
58
59- The crates minimum supported Rust version (MSRV) is now 1.81.
60
61- Functional and performance comparisons are made against the
62  reference C xxHash library version 0.8.2, which includes a stable
63  XXH3 algorithm.
64
65- Support for randomly-generated hasher instances is now behind the
66  `random` feature flag. It was previously combined with the `std`
67  feature flag.
68
69### Removed
70
71- The deprecated type aliases `XxHash` and `RandomXxHashBuilder` have
72  been removed. Replace them with `XxHash64` and
73  `xxhash64::RandomState` respectively.
74
75- `RandomXxHashBuilder32` and `RandomXxHashBuilder64` are no longer
76  available at the top-level of the crate. Replace them with
77  `xxhash32::RandomState` and ``xxhash64::RandomState` respectively.
78
79- `Xxh3Hash64` and `xx3::Hash64` have been renamed to `XxHash3_64` and
80  `xxhash3_64::Hasher` respectively.
81
82- The free functions `xxh3::hash64`, `xxh3::hash64_with_seed`, and
83  `xxh3::hash64_with_secret` are now associated functions of
84  `xxhash3_64::Hasher`: `oneshot`, `oneshot_with_seed` and
85  `oneshot_with_secret`. Note that the argument order has changed.
86
87- Support for the [digest][] crate has been removed. The digest crate
88  is for **cryptographic** hash functions and xxHash is
89  **non-cryptographic**.
90
91- `XxHash32` and `XxHash64` no longer implement `Copy`. This prevents
92  accidentally mutating a duplicate instance of the state instead of
93  the original state. `Clone` is still implemented so you can make
94  deliberate duplicates.
95
96- The XXH3 128-bit variant is not yet re-written. Work is in progress
97  for this.
98
99- We no longer provide support for randomly-generated instances of the
100  XXH3 64-bit variant. The XXH3 algorithm takes both a seed and a
101  secret as input and deciding what to randomize is non-trivial and
102  can have negative impacts on performance.
103
104[digest]: https://docs.rs/digest/latest/digest/
105