DJBHash

<< Click to Display Table of Contents >>

Navigation:  Functions >

DJBHash

SIGNATURE=IW.Common.HashUtils.DJBHash@Pointer@Integer

 

ETYPE=Function

 

Declaration:

Delphi:

function DJBHash(AData: Pointer; ADataLength: Integer): Cardinal;

C++:

unsigned DJBHash(void * AData, int ADataLength);

 

Unit: IW.Common.HashUtils.pas

 

Description: FNV1aMeiyan is the fastest general purpose hash function that I'm aware of, with excellent distribution and low collision rate. It is faster than xxHash and others which claim to be "the fastest" Time (ms) hashing integers from 0 to MAXINT. Please note that the advantage gets bigger when data size increases (including strings) 32-bit Release: DJBHash: 6719 FNV1aHash: 5214 Murmur2Hash: 5775 FNV1aMeiyanHash (Pointer): 4572 FNV1aMeiyanHash (PInteger): 3806 

 

Parameters:

 

•AData: Pointer

 

•ADataLength: Integer

 

Result(Cardinal):