Skip to content

Commit 612704f

Browse files
shepmasterPSeitz
authored andcommitted
Upgrade to twox-hash 2.0
1 parent e52bceb commit 612704f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ std = []
4848
nightly = []
4949

5050
[dependencies]
51-
twox-hash = { version = "1.6.3", default-features = false, optional = true }
51+
twox-hash = { version = "2.0.0", default-features = false, features = ["xxhash32"], optional = true }
5252

5353
[profile.bench]
5454
codegen-units = 1

src/frame/compress.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,7 @@ impl<W: io::Write> FrameEncoder<W> {
311311
self.w.write_all(&block_info_buffer[..])?;
312312
self.w.write_all(block_data)?;
313313
if self.frame_info.block_checksums {
314-
let mut block_hasher = XxHash32::with_seed(0);
315-
block_hasher.write(block_data);
316-
let block_checksum = block_hasher.finish() as u32;
314+
let block_checksum = XxHash32::oneshot(0, block_data);
317315
self.w.write_all(&block_checksum.to_le_bytes())?;
318316
}
319317

0 commit comments

Comments
 (0)