Skip to content

Commit cce62ba

Browse files
committed
switch to using twox-hash instead due to licensing issues
1 parent cf6d7b0 commit cce62ba

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

Cargo.lock

+12-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ toml_edit = { version = "0.22.14", features = ["serde"] }
101101
tracing = "0.1.40" # be compatible with rustc_log: https://github.com/rust-lang/rust/blob/e51e98dde6a/compiler/rustc_log/Cargo.toml#L9
102102
tracing-chrome = "0.7.2"
103103
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
104+
twox-hash = "1.6.3"
104105
unicase = "2.7.0"
105106
unicode-width = "0.1.12"
106107
unicode-xid = "0.2.4"
107108
url = "2.5.0"
108109
varisat = "0.2.2"
109110
walkdir = "2.5.0"
110111
windows-sys = "0.52"
111-
xxhash-rust = { version = "0.8.10", features = ["xxh3"] }
112112

113113
[workspace.lints.rust]
114114
rust_2018_idioms = "warn" # TODO: could this be removed?
@@ -200,11 +200,11 @@ toml.workspace = true
200200
toml_edit.workspace = true
201201
tracing.workspace = true
202202
tracing-subscriber.workspace = true
203+
twox-hash.workspace = true
203204
unicase.workspace = true
204205
unicode-width.workspace = true
205206
url.workspace = true
206207
walkdir.workspace = true
207-
xxhash-rust.workspace = true
208208
supports-unicode = "3.0.0"
209209

210210
[target.'cfg(target_has_atomic = "64")'.dependencies]

src/cargo/core/compiler/fingerprint/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ use serde::de;
381381
use serde::ser;
382382
use serde::{Deserialize, Serialize};
383383
use tracing::{debug, info};
384-
use xxhash_rust::xxh3;
384+
use twox_hash::XxHash64;
385385

386386
use crate::core::compiler::unit_graph::UnitDep;
387387
use crate::core::Package;
@@ -2523,7 +2523,7 @@ impl ChecksumAlgo {
25232523
fn hash_len(&self) -> usize {
25242524
match self {
25252525
ChecksumAlgo::Sha256 => 32,
2526-
ChecksumAlgo::XxHash => 16,
2526+
ChecksumAlgo::XxHash => 8,
25272527
}
25282528
}
25292529
}
@@ -2619,11 +2619,11 @@ impl Checksum {
26192619
}
26202620
ChecksumAlgo::XxHash => {
26212621
digest(
2622-
xxh3::Xxh3::new(),
2622+
XxHash64::with_seed(0),
26232623
|h, b| {
2624-
h.update(b);
2624+
h.write(b);
26252625
},
2626-
|h, out| out.copy_from_slice(&h.digest128().to_be_bytes()),
2626+
|h, out| out.copy_from_slice(&h.finish().to_be_bytes()),
26272627
contents,
26282628
&mut buf,
26292629
value,

0 commit comments

Comments
 (0)