nightmaremail

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

cdb_hash.c (198B)


      1 #include "cdb.h"
      2 
      3 uint32 cdb_hash(buf,len)
      4 unsigned char *buf;
      5 unsigned int len;
      6 {
      7   uint32 h;
      8 
      9   h = 5381;
     10   while (len) {
     11     --len;
     12     h += (h << 5);
     13     h ^= (uint32) *buf++;
     14   }
     15   return h;
     16 }