feature/bloom_filter #55
@@ -23,7 +23,7 @@ interface
|
||||
|
||||
uses
|
||||
memory.heap,
|
||||
core.enc.md5,
|
||||
core.enc.fnv1a,
|
||||
core.strings,
|
||||
io.syslog,
|
||||
debug.tracer,
|
||||
@@ -64,19 +64,8 @@ procedure forEach(map : PHashMap; cb : THashForEachCb; ud : void);
|
||||
implementation
|
||||
|
||||
function KeyHash(key : pchar) : uint32;
|
||||
var
|
||||
KeyLength : uint32;
|
||||
MD5_Hash : PMD5Digest;
|
||||
Hash128 : puint128;
|
||||
Hash32 : uint32;
|
||||
|
||||
begin
|
||||
KeyLength:= StringSize(key);
|
||||
MD5_Hash:= MD5Buffer(puint8(key), KeyLength);
|
||||
Hash128:= puint128(MD5_Hash);
|
||||
Hash32:= MD5To32(Hash128);
|
||||
KeyHash:= Hash32;
|
||||
kfree(void(MD5_Hash));
|
||||
KeyHash := Hash_FNV1a32(void(uint32(key)), StringSize(key));
|
||||
end;
|
||||
|
||||
function hashIndex(size : uint32; hash : uint32) : uint32;
|
||||
|
||||
Reference in new issue
Block a user