#1 2015-02-09 07:51:31

vbz007
Member
Registered: 2014-07-17
Posts: 5

synlz bug!

function HashString(str: AnsiString): cardinal;
begin
   Result:=Hash32(pointer(str), Length(str))
end;

str:

'120546506@115871'

'141084032@115871'

all result=3273449680.

hash32 bug...

Offline

#2 2015-02-09 09:52:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: synlz bug!

Hash32 is at the lever of Adler32, which is used by deflate.
So IMHO this is not a bug.
Please note that Hash32 is NOT part of SynLZ by itself.
Just part of some higher level wrappers around it.

crc32c is better than hash32, about collisions.
We use crc32c everywhere in our code, but I would not change the algorithm of higher wrappers, since it is currently used at storage level.

Offline

Board footer

Powered by FluxBB