Skip to content

Commit 39f61cf

Browse files
committed
switch to using twox-hash instead due to licensing issues
1 parent a45d663 commit 39f61cf

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
@@ -103,14 +103,14 @@ toml_edit = { version = "0.22.20", features = ["serde"] }
103103
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
104104
tracing-chrome = "0.7.2"
105105
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
106+
twox-hash = "1.6.3"
106107
unicase = "2.7.0"
107108
unicode-width = "0.2.0"
108109
unicode-xid = "0.2.4"
109110
url = "2.5.2"
110111
varisat = "0.2.2"
111112
walkdir = "2.5.0"
112113
windows-sys = "0.59"
113-
xxhash-rust = { version = "0.8.10", features = ["xxh3"] }
114114

115115
[workspace.lints.rust]
116116
rust_2018_idioms = "warn" # TODO: could this be removed?
@@ -203,11 +203,11 @@ toml.workspace = true
203203
toml_edit.workspace = true
204204
tracing = { workspace = true, features = ["attributes"] }
205205
tracing-subscriber.workspace = true
206+
twox-hash.workspace = true
206207
unicase.workspace = true
207208
unicode-width.workspace = true
208209
url.workspace = true
209210
walkdir.workspace = true
210-
xxhash-rust.workspace = true
211211
supports-unicode = "3.0.0"
212212

213213
[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;
@@ -2501,7 +2501,7 @@ impl ChecksumAlgo {
25012501
fn hash_len(&self) -> usize {
25022502
match self {
25032503
ChecksumAlgo::Sha256 => 32,
2504-
ChecksumAlgo::XxHash => 16,
2504+
ChecksumAlgo::XxHash => 8,
25052505
}
25062506
}
25072507
}
@@ -2597,11 +2597,11 @@ impl Checksum {
25972597
}
25982598
ChecksumAlgo::XxHash => {
25992599
digest(
2600-
xxh3::Xxh3::new(),
2600+
XxHash64::with_seed(0),
26012601
|h, b| {
2602-
h.update(b);
2602+
h.write(b);
26032603
},
2604-
|h, out| out.copy_from_slice(&h.digest128().to_be_bytes()),
2604+
|h, out| out.copy_from_slice(&h.finish().to_be_bytes()),
26052605
contents,
26062606
&mut buf,
26072607
value,

0 commit comments

Comments
 (0)