feature/bloom_filter #55

Merged
admin merged 3 commits from feature/bloom_filter into develop 2026-03-08 14:24:46 +00:00
Showing only changes of commit f2e5f3535a - Show all commits
+2 -13
View File
@@ -23,7 +23,7 @@ interface
uses uses
memory.heap, memory.heap,
core.enc.md5, core.enc.fnv1a,
core.strings, core.strings,
io.syslog, io.syslog,
debug.tracer, debug.tracer,
@@ -64,19 +64,8 @@ procedure forEach(map : PHashMap; cb : THashForEachCb; ud : void);
implementation implementation
function KeyHash(key : pchar) : uint32; function KeyHash(key : pchar) : uint32;
var
KeyLength : uint32;
MD5_Hash : PMD5Digest;
Hash128 : puint128;
Hash32 : uint32;
begin begin
KeyLength:= StringSize(key); KeyHash := Hash_FNV1a32(void(uint32(key)), StringSize(key));
MD5_Hash:= MD5Buffer(puint8(key), KeyLength);
Hash128:= puint128(MD5_Hash);
Hash32:= MD5To32(Hash128);
KeyHash:= Hash32;
kfree(void(MD5_Hash));
end; end;
function hashIndex(size : uint32; hash : uint32) : uint32; function hashIndex(size : uint32; hash : uint32) : uint32;