1 #include "portable_io.h"
2 #define HASH_TYPE unsigned char
4 //#include "super_fast_hash.h"
5 //#define hash_function super_fast_hash
7 #define hash_function sha1_hash
9 static inline int hash_compare(HASH_TYPE *h1, HASH_TYPE *h2)
13 for (i = 0; i < HASH_SIZE; i++) {
22 static inline void hash_to_asc(HASH_TYPE *hash, char *asc)
25 const char hexchar[] = "0123456789abcdef";
27 for (i = 0; i < HASH_SIZE; i++) {
28 asc[2 * i] = hexchar[hash[i] >> 4];
29 asc[2 * i + 1] = hexchar[hash[i] & 0xf];
31 asc[2 * HASH_SIZE] = '\0';