From 8680e5ef70428fef91910974aa136903791c2a7d Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Tue, 31 Jul 2018 22:08:13 +0100 Subject: [PATCH] Fix intermittent problem with autochunking not being deterministic Signed-off-by: Jonathan Dieter --- src/lib/buzhash/buzhash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/buzhash/buzhash.c b/src/lib/buzhash/buzhash.c index c1fc399..3c35f5e 100644 --- a/src/lib/buzhash/buzhash.c +++ b/src/lib/buzhash/buzhash.c @@ -108,16 +108,16 @@ uint32_t buzhash_update (buzHash *b, const char *s, size_t window) { b->window[b->window_fill] = *s; b->window_fill++; if(b->window_fill < b->window_size) { - b->h ^= rol32 (buzhash_table[(size_t) (*s)], window - b->window_fill); + b->h ^= rol32 (buzhash_table[(uint8_t) (*s)], window - b->window_fill); return 1; } else { - b->h ^= buzhash_table[(size_t) (*s)]; + b->h ^= buzhash_table[(uint8_t) (*s)]; return b->h; } } b->h = rol32 (b->h, 1) ^ - rol32 (buzhash_table[(size_t) b->window[b->window_loc]], b->window_size) ^ - buzhash_table[(size_t) *s]; + rol32 (buzhash_table[(uint8_t) b->window[b->window_loc]], b->window_size) ^ + buzhash_table[(uint8_t) *s]; b->window[b->window_loc++] = *s; b->window_loc %= b->window_size; return b->h; -- 2.30.2