Skip Menu |

This queue is for tickets about the Digest-FNV CPAN distribution.

Report information
The Basics
Id: 88785
Status: open
Priority: 0/
Queue: Digest-FNV

People
Owner: Nobody in particular
Requestors: aardbeiplantje [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.00
Fixed in: (no value)



Subject: Digest::FNV calculates a wrong hash with \0 in the data
When using binary data, it happens a lot that \0 bytes are in the to be hashed data. This breaks the loop in e.g. fnvlib/hash_32.c as the loop checks the *s: while(*s){ ... } This makes for more hash collisions when trying to make a MPH.
On Wed Sep 18 10:39:46 2013, CowboyTim wrote: Show quoted text
> When using binary data, it happens a lot that \0 bytes are in the to > be hashed data. This breaks the loop in e.g. fnvlib/hash_32.c as the > loop checks the *s: > > while(*s){ > ... > } > > This makes for more hash collisions when trying to make a MPH.
seems like the original implementation provide some helpers to take into account the length look at the fnv_32_buf and fnv_64_buf these are the functions we want to use... http://www.isthe.com/chongo/src/fnv/hash_32.c