feature/bloom_filter #55
@@ -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;
|
||||||
|
|||||||
Reference in new issue
Block a user