From d986d93318a35a04991d6b403720e27cea921975 Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Fri, 18 Oct 2024 09:19:58 -0400 Subject: [PATCH] Upgrade to twox-hash 2.0 --- Cargo.toml | 2 +- src/frame/compress.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 084cadb..e7e3bf2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ std = [] nightly = [] [dependencies] -twox-hash = { version = "1.6.3", default-features = false, optional = true } +twox-hash = { version = "2.0.0", default-features = false, features = ["xxhash32"], optional = true } [profile.bench] codegen-units = 1 diff --git a/src/frame/compress.rs b/src/frame/compress.rs index cee32eb..88c3422 100644 --- a/src/frame/compress.rs +++ b/src/frame/compress.rs @@ -311,9 +311,7 @@ impl FrameEncoder { self.w.write_all(&block_info_buffer[..])?; self.w.write_all(block_data)?; if self.frame_info.block_checksums { - let mut block_hasher = XxHash32::with_seed(0); - block_hasher.write(block_data); - let block_checksum = block_hasher.finish() as u32; + let block_checksum = XxHash32::oneshot(0, block_data); self.w.write_all(&block_checksum.to_le_bytes())?; }