Server 0.0.1
HTTP/REST server implementation

src/utils/hash.c

Go to the documentation of this file.
00001 
00024 #include <ctype.h>
00025 #include <sys/types.h>
00026 
00027 #include "utils/hash.h"
00028 
00042 unsigned long
00043 sdbm(const unsigned char * str, size_t len)
00044 {
00045         unsigned long hash = 0;
00046 
00047         for(; 0 < len; str++, len--)
00048                 hash = tolower(*str) + (hash << 6) + (hash << 16) - hash;
00049 
00050         return hash;
00051 }
00052 
00053 // vim: set ts=4 sw=4:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines