#ifndef CHECKSUM_H #define CHECKSUM_H #include /* define apr_uint32_t */ typedef unsigned char ub1; #define HASHSTATE 8 /* -------------------------------------------------------------------- hash() -- hash a variable-length key into a 256-bit value k : the key (the unaligned variable-length array of bytes) len : the length of the key, counting by bytes state : an array of HASHSTATE 4-byte values (256 bits) The state is the checksum. Every bit of the key affects every bit of the state. There are no funnels. About 112+6.875len instructions. If you are hashing n strings (ub1 **)k, do it like this: for (i=0; i<8; ++i) state[i] = 0x9e3779b9; for (i=0, h=0; i