None
EN
A seed-independent hash collision in GxHash
['Ragnar', 'Groot Koerkamp']
home on CuriousCoding
Sadly, it turns out that gxhash128 (the 128-bit version of gxhash) 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 use gxhash :: gxhash128 ; fn main () { // * **** let a = "GGAGGAAGTCCCCCAGGAGTCCTGGGATGAAGGTTATTCGACTCTCTCAATTCCTCCTGAAATGTTGGCCTCGTACCAGTCTTAAGCA" ; let b = "GGAGGAAGTCCCCCAGGAGTCCTGGGATGAAGGTTATTCGACTCTCTCAATTCCTCCTGAAAGGTTGGCCTCGTACCAGTCTTACAGC" ; for _ in 0 .. 1000000 { let seed = rand :: random :: < i64 > (); let hash_a = gxhash128 ( a .
as_bytes (), seed ); let hash_b = gxhash128 ( b .
( "B: {b} => {hash_b} " ); assert_eq!
( hash_a , hash_b ); // This passes, even though I don't want it to. }