good evening , i need a help from the people who all see this question... can anybody pl. give me the coding for a HASHING function (searching algorithm) in C??? i need that urgently... thank you S.R.Vignesh
[cpp] unsigned xor_hash ( void *key, int len ) { unsigned char *p = key; unsigned h = 0; int i; for ( i = 0; i < len; i++ ) h ^= p; return h; } [cpp] here is another and better one [cpp] unsigned rot_hash ( void *key, int len ) { unsigned char *p = key; unsigned h = 0; int i; for ( i = 0; i < len; i++ ) h = ( h << 4 ) ^ ( h >> 28 ) ^ p; return h; } [/cpp]