]> mj.ucw.cz Git - libucw.git/blob - lib/hash-block.c
Prevent multiple inclusion.
[libucw.git] / lib / hash-block.c
1 /*
2  *      Sherlock Library -- Block Hash Function
3  *
4  *      (c) 2002 Martin Mares <mj@ucw.cz>
5  */
6
7 #include "lib/lib.h"
8 #include "lib/hashfunc.h"
9
10 uns
11 hash_block(byte *k, uns len)
12 {
13   uns h = len;
14   while (len--)
15     h = h*37 + *k++;
16   return h;
17 }