For a pangenome deduplication tool I’m working on (pandedup), I’m using 128-bit hashes as “unique” identifiers of substrings.
Sadly, it turns out that gxhash128 has a hash collision between the two
strings of length 88 below that only differ in 5 positions, regardless of the value of the seed.
Looking at the strings, this clearly isn’t a random collision. Those could be expected when doing \(2^{64}\) lookups in a dictionary of \(2^{64}\) keys, but my data is nowhere near that large.
| |
If we drop the first character from each, then the hashes do become distinct.
In general, making similar changes to both strings seems to still give the same
problem, but not always. For example, changing the G at index 3 to a C
does result in different hashes.
Anyway, I shall search for a better hash function.