FreeBSD/sys/libkern/murmur3_32.c
/*
 * Simplified version of the above optimized for aligned sequences of
 * 32-bit words.  The count argument is the number of words, not the
 * length in bytes.
 */
Simplified version of the above optimized for aligned sequences of
32-bit words.  The count argument is the number of words, not the
length in bytes.
Simplified version of the above optimized for aligned sequences of 32 - bit words . The count argument is the number of words not the length in bytes .
uint32_t
murmur3_32_hash32(const uint32_t *data, size_t count, uint32_t seed)
{
	uint32_t hash, k;
	size_t res;
	for (res = count, hash = seed; res > 0; res--, data++) {
		k = le32toh(*data);
		k *= 0xcc9e2d51;
		k = rol32(k, 15);
		k *= 0x1b873593;
		hash ^= k;
		hash = rol32(hash, 13);
		hash *= 5;
		hash += 0xe6546b64;
	}
	hash ^= (uint32_t)count;
	hash ^= hash >> 16;
	hash *= 0x85ebca6b;
	hash ^= hash >> 13;
	hash *= 0xc2b2ae35;
	hash ^= hash >> 16;
	return (hash);
}
uint32_t murmur3_32_hash32 ( const uint32_t * data , size_t count , uint32_t seed ) { uint32_t hash , k ; size_t res ; for ( res = count , hash = seed ; res > 0 ; res -- , data ++ ) { k = le32toh ( * data ) ; k *= 0xcc9e2d51 ; k = rol32 ( k , 15 ) ; k *= 0x1b873593 ; hash ^= k ; hash = rol32 ( hash , 13 ) ; hash *= 5 ; hash += 0xe6546b64 ; } hash ^= ( uint32_t ) count ; hash ^= hash >> 16 ; hash *= 0x85ebca6b ; hash ^= hash >> 13 ; hash *= 0xc2b2ae35 ; hash ^= hash >> 16 ; return ( hash ) ; }
Simplified version of the above optimized for aligned sequences of
 32-bit words.
Simplified version of the above optimized for aligned sequences of 32 - bit words .
/* iterate */ /* finalize */