MySQL 8.0.40
Source Code Documentation
my_murmur3.cc File Reference

Implementation of 32-bit version of MurmurHash3 - fast non-cryptographic hash function with good statistical properties, which is based on public domain code by Austin Appleby. More...

#include "my_murmur3.h"
#include "my_byteorder.h"

Macros

#define ROTL32(x, y)   rotl32(x, y)
 

Functions

uint32 rotl32 (uint32 x, char r)
 
uint32 murmur3_32 (const uchar *key, size_t len, uint32 seed)
 Compute 32-bit version of MurmurHash3 hash for the key. More...
 

Detailed Description

Implementation of 32-bit version of MurmurHash3 - fast non-cryptographic hash function with good statistical properties, which is based on public domain code by Austin Appleby.

Macro Definition Documentation

◆ ROTL32

#define ROTL32 (   x,
 
)    rotl32(x, y)

Function Documentation

◆ murmur3_32()

uint32 murmur3_32 ( const uchar key,
size_t  len,
uint32  seed 
)

Compute 32-bit version of MurmurHash3 hash for the key.

Parameters
keyKey for which hash value to be computed.
lenKey length.
seedSeed for hash computation.
Note
WARNING! Since MurmurHash3 is known to be susceptible to "hash DoS" attack it should not be used in any situation where attacker has control over key being hashed and thus can cause performance problems due to degradation of hash lookup to linear list search.
Returns
Hash value for the key.

◆ rotl32()

uint32 rotl32 ( uint32  x,
char  r 
)
inline