]>
jfr.im git - irc/gameservirc.git/blob - gameserv/hash.cpp
5 unsigned long sHASH(const unsigned char *name
);
6 unsigned long iHASH(const unsigned char *name
);
7 list
<Player
*> players
[U_TABLE_SIZE
];
9 unsigned long sHASH(const unsigned char *name
)
11 unsigned long h
= 0, g
;
15 h
= (h
<< 4) + (*name
++); // Case sensitive for numerics
16 if ((g
= (h
& 0xF0000000)))
20 return h
% U_TABLE_SIZE
;
23 unsigned long iHASH(const unsigned char *name
)
25 unsigned long h
= 0, g
;
29 h
= (h
<< 4) + tolower(*name
++);
30 if ((g
= (h
& 0xF0000000)))
34 return h
% U_TABLE_SIZE
;