]> mj.ucw.cz Git - libucw.git/blob - lib/hash-istring.c
Prevent multiple inclusion.
[libucw.git] / lib / hash-istring.c
1 /*
2  *      Sherlock Library -- Case-Insensitive String Hash Function
3  *
4  *      (c) 2002 Martin Mares <mj@ucw.cz>
5  */
6
7 #include "lib/lib.h"
8 #include "lib/hashfunc.h"
9 #include "lib/chartype.h"
10
11 #include <string.h>
12
13 uns
14 hash_string_nocase(byte *k)
15 {
16   uns h = strlen(k);
17   while (*k)
18     h = h*37 + Cupcase(*k++);
19   return h;
20 }