diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/eet/src/lib/eet_utils.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/libraries/eet/src/lib/eet_utils.c b/libraries/eet/src/lib/eet_utils.c deleted file mode 100644 index b04ad1b..0000000 --- a/libraries/eet/src/lib/eet_utils.c +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include <config.h> | ||
3 | #endif /* ifdef HAVE_CONFIG_H */ | ||
4 | |||
5 | #include <stdio.h> | ||
6 | #include <math.h> | ||
7 | |||
8 | #include "Eet.h" | ||
9 | #include "Eet_private.h" | ||
10 | |||
11 | int | ||
12 | _eet_hash_gen(const char *key, | ||
13 | int hash_size) | ||
14 | { | ||
15 | int hash_num = 0; | ||
16 | int value, i; | ||
17 | int mask; | ||
18 | unsigned char *ptr; | ||
19 | |||
20 | /* no string - index 0 */ | ||
21 | if (!key) | ||
22 | return 0; | ||
23 | |||
24 | /* calc hash num */ | ||
25 | for (i = 0, ptr = (unsigned char *)key, value = (int)(*ptr); | ||
26 | value; | ||
27 | ptr++, i++, value = (int)(*ptr)) | ||
28 | hash_num ^= (value | (value << 8)) >> (i & 0x7); | ||
29 | |||
30 | /* mask it */ | ||
31 | mask = (1 << hash_size) - 1; | ||
32 | hash_num &= mask; | ||
33 | /* return it */ | ||
34 | return hash_num; | ||
35 | } | ||
36 | |||