Use a 32 bit seed for tommy_strhash_u32

The previous 64 bit high part was anyway ignored.
This commit is contained in:
Andrea Mazzoleni 2025-10-28 11:44:23 +01:00
parent a652eedb3c
commit f4f386983a
2 changed files with 2 additions and 2 deletions

View file

@ -165,7 +165,7 @@ tommy_uint64_t tommy_hash_u64(tommy_uint64_t init_val, const void* void_key, tom
return c + ((tommy_uint64_t)b << 32);
}
tommy_uint32_t tommy_strhash_u32(tommy_uint64_t init_val, const void* void_key)
tommy_uint32_t tommy_strhash_u32(tommy_uint32_t init_val, const void* void_key)
{
const unsigned char* key = tommy_cast(const unsigned char*, void_key);
tommy_uint32_t a, b, c;

View file

@ -93,7 +93,7 @@ tommy_uint64_t tommy_hash_u64(tommy_uint64_t init_val, const void* void_key, tom
* This function is endianness independent.
* \return The hash value of 32 bits.
*/
tommy_uint32_t tommy_strhash_u32(tommy_uint64_t init_val, const void* void_key);
tommy_uint32_t tommy_strhash_u32(tommy_uint32_t init_val, const void* void_key);
/**
* Integer reversible hash function for 32 bits.