Skip to content

Commit a264c26

Browse files
committed
switch to using twox-hash instead due to licensing issues
1 parent 0f12264 commit a264c26

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

Cargo.lock

Lines changed: 12 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ toml_edit = { version = "0.22.17", features = ["serde"] }
102102
tracing = { version = "0.1.40", default-features = false, features = ["std"] } # be compatible with rustc_log: https://github.com/rust-lang/rust/blob/e51e98dde6a/compiler/rustc_log/Cargo.toml#L9
103103
tracing-chrome = "0.7.2"
104104
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
105+
twox-hash = "1.6.3"
105106
unicase = "2.7.0"
106107
unicode-width = "0.1.13"
107108
unicode-xid = "0.2.4"
108109
url = "2.5.2"
109110
varisat = "0.2.2"
110111
walkdir = "2.5.0"
111112
windows-sys = "0.52"
112-
xxhash-rust = { version = "0.8.10", features = ["xxh3"] }
113113

114114
[workspace.lints.rust]
115115
rust_2018_idioms = "warn" # TODO: could this be removed?
@@ -201,11 +201,11 @@ toml.workspace = true
201201
toml_edit.workspace = true
202202
tracing = { workspace = true, features = ["attributes"] }
203203
tracing-subscriber.workspace = true
204+
twox-hash.workspace = true
204205
unicase.workspace = true
205206
unicode-width.workspace = true
206207
url.workspace = true
207208
walkdir.workspace = true
208-
xxhash-rust.workspace = true
209209
supports-unicode = "3.0.0"
210210

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

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

Lines changed: 5 additions & 5 deletions
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)