Add hash_from_int function

This commit is contained in:
Joel Rosdahl 2010-07-21 00:12:17 +02:00
parent d4f478176e
commit c45bf6090d
2 changed files with 7 additions and 0 deletions

View File

@ -30,6 +30,12 @@ hash_from_string(void *str)
return murmurhashneutral2(str, strlen((const char *)str), 0);
}
unsigned
hash_from_int(int i)
{
return murmurhashneutral2(&i, sizeof(int), 0);
}
int
strings_equal(void *str1, void *str2)
{

View File

@ -11,6 +11,7 @@ struct file_hash
};
unsigned hash_from_string(void *str);
unsigned hash_from_int(int i);
int strings_equal(void *str1, void *str2);
int file_hashes_equal(struct file_hash *fh1, struct file_hash *fh2);