Skip to content

Commit

Permalink
switch to using twox-hash instead due to licensing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaeroxe committed Jun 26, 2024
1 parent 87aecfc commit 59441b6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
19 changes: 12 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ toml_edit = { version = "0.22.14", features = ["serde"] }
tracing = "0.1.40" # be compatible with rustc_log: https://github.com/rust-lang/rust/blob/e51e98dde6a/compiler/rustc_log/Cargo.toml#L9
tracing-chrome = "0.7.2"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
twox-hash = "1.6.3"
unicase = "2.7.0"
unicode-width = "0.1.12"
unicode-xid = "0.2.4"
url = "2.5.0"
varisat = "0.2.2"
walkdir = "2.5.0"
windows-sys = "0.52"
xxhash-rust = { version = "0.8.10", features = ["xxh3"] }

[workspace.lints.rust]
rust_2018_idioms = "warn" # TODO: could this be removed?
Expand Down Expand Up @@ -200,11 +200,11 @@ toml.workspace = true
toml_edit.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
twox-hash.workspace = true
unicase.workspace = true
unicode-width.workspace = true
url.workspace = true
walkdir.workspace = true
xxhash-rust.workspace = true
supports-unicode = "3.0.0"

[target.'cfg(target_has_atomic = "64")'.dependencies]
Expand Down
10 changes: 5 additions & 5 deletions src/cargo/core/compiler/fingerprint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ use serde::de;
use serde::ser;
use serde::{Deserialize, Serialize};
use tracing::{debug, info};
use xxhash_rust::xxh3;
use twox_hash::XxHash64;

use crate::core::compiler::unit_graph::UnitDep;
use crate::core::Package;
Expand Down Expand Up @@ -2523,7 +2523,7 @@ impl ChecksumAlgo {
fn hash_len(&self) -> usize {
match self {
ChecksumAlgo::Sha256 => 32,
ChecksumAlgo::XxHash => 16,
ChecksumAlgo::XxHash => 8,
}
}
}
Expand Down Expand Up @@ -2619,11 +2619,11 @@ impl Checksum {
}
ChecksumAlgo::XxHash => {
digest(
xxh3::Xxh3::new(),
XxHash64::with_seed(0),
|h, b| {
h.update(b);
h.write(b);
},
|h, out| out.copy_from_slice(&h.digest128().to_be_bytes()),
|h, out| out.copy_from_slice(&h.finish().to_be_bytes()),
contents,
&mut buf,
value,
Expand Down

0 comments on commit 59441b6

Please sign in to comment.