summaryrefslogtreecommitdiffstats
path: root/mbbsd/toolkit.c
blob: 99f80e0b2b056813f5ec27ed88b50a39d3c0ab09 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* $Id: toolkit.c,v 1.4 2002/07/21 09:26:02 in2 Exp $ */
#include "bbs.h"

unsigned
StringHash(unsigned char *s)
{
    unsigned int    v = 0;
    while (*s) {
    v = (v << 8) | (v >> 24);
    v ^= toupper(*s++); /* note this is case insensitive */
    }
    return (v * 2654435769UL) >> (32 - HASH_BITS);
}