From 2d2e4fa6ed3a72ac445cbed2b3618f09990bc274 Mon Sep 17 00:00:00 2001 From: DoumanAsh Date: Fri, 20 Dec 2024 09:39:17 +0900 Subject: [PATCH] 0.8.13 --- Cargo.toml | 2 +- src/xxh3.rs | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4d721eb..dafdd66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xxhash-rust" -version = "0.8.12" +version = "0.8.13" authors = ["Douman "] edition = "2018" description = "Implementation of xxhash" diff --git a/src/xxh3.rs b/src/xxh3.rs index 376c4c8..f622215 100644 --- a/src/xxh3.rs +++ b/src/xxh3.rs @@ -640,23 +640,20 @@ fn xxh3_64_129to240(input: &[u8], seed: u64, secret: &[u8]) -> u64 { let nb_rounds = input.len() / 16; let mut idx = 0; - let input_chunks = get_aligned_chunk_ref::<[[[u8; 8]; 2]; INITIAL_CHUNK_LEN]>(input, 0); - let mut secret_chunks = get_aligned_chunk_ref::<[[[u8; 8]; 2]; INITIAL_CHUNK_LEN]>(secret, 0); - while idx < 8 { + while idx < INITIAL_CHUNK_LEN { acc = acc.wrapping_add(mix16_b( - &input_chunks[idx], - &secret_chunks[idx], + get_aligned_chunk_ref(input, 16*idx), + get_aligned_chunk_ref(secret, 16*idx), seed )); idx = idx.wrapping_add(1); } acc = avalanche(acc); - secret_chunks = get_aligned_chunk_ref::<[[[u8; 8]; 2]; INITIAL_CHUNK_LEN]>(secret, START_OFFSET); while idx < nb_rounds { acc = acc.wrapping_add(mix16_b( get_aligned_chunk_ref(input, 16*idx), - &secret_chunks[idx-8], + get_aligned_chunk_ref(secret, 16*(idx-8) + START_OFFSET), seed )); idx = idx.wrapping_add(1);