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
|
Banned
|
|
| 27Mar2010,18:05 | #1 |
|
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 |
|
Mentor
|
![]() |
| 28Mar2010,21:07 | #2 |
|
Contributor
|
|
| 28Mar2011,16:11 | #3 |
|
[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[i]; 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[i]; return h; } [/cpp] |
|
Contributor
|
|
| 28Mar2011,16:12 | #4 |
|
sorry for late reply.
|