Blender V4.3
hash_mm2a.cc File Reference
#include "BLI_compiler_attrs.h"
#include "BLI_hash_mm2a.hh"

Go to the source code of this file.

Macros

#define MM2A_M   0x5bd1e995
 
#define MM2A_MIX(h, k)
 
#define MM2A_MIX_FINALIZE(h)
 

Functions

static void mm2a_mix_tail (BLI_HashMurmur2A *mm2, const uchar **data, size_t *len)
 
void BLI_hash_mm2a_init (BLI_HashMurmur2A *mm2, uint32_t seed)
 
void BLI_hash_mm2a_add (BLI_HashMurmur2A *mm2, const uchar *data, size_t len)
 
void BLI_hash_mm2a_add_int (BLI_HashMurmur2A *mm2, int data)
 
uint32_t BLI_hash_mm2a_end (BLI_HashMurmur2A *mm2)
 
uint32_t BLI_hash_mm2 (const uchar *data, size_t len, uint32_t seed)
 

Detailed Description

Functions to compute Murmur2A hash key.

A very fast hash generating int32 result, with few collisions and good repartition.

See also: reference implementation:

Warning
Do not store that hash in files or such, it is not endian-agnostic, so you should only use it for temporary data.

Definition in file hash_mm2a.cc.

Macro Definition Documentation

◆ MM2A_M

#define MM2A_M   0x5bd1e995

Definition at line 26 of file hash_mm2a.cc.

Referenced by BLI_hash_mm2().

◆ MM2A_MIX

#define MM2A_MIX ( h,
k )
Value:
{ \
(k) *= MM2A_M; \
(k) ^= (k) >> 24; \
(k) *= MM2A_M; \
(h) = ((h) * MM2A_M) ^ (k); \
} \
(void)0
#define MM2A_M
Definition hash_mm2a.cc:26

Definition at line 28 of file hash_mm2a.cc.

Referenced by BLI_hash_mm2(), BLI_hash_mm2a_add(), BLI_hash_mm2a_end(), and mm2a_mix_tail().

◆ MM2A_MIX_FINALIZE

#define MM2A_MIX_FINALIZE ( h)
Value:
{ \
(h) ^= (h) >> 13; \
(h) *= MM2A_M; \
(h) ^= (h) >> 15; \
} \
(void)0

Definition at line 37 of file hash_mm2a.cc.

Referenced by BLI_hash_mm2(), and BLI_hash_mm2a_end().

Function Documentation

◆ BLI_hash_mm2()

uint32_t BLI_hash_mm2 ( const unsigned char * data,
size_t len,
uint32_t seed )

◆ BLI_hash_mm2a_add()

◆ BLI_hash_mm2a_add_int()

void BLI_hash_mm2a_add_int ( BLI_HashMurmur2A * mm2,
int data )

Definition at line 85 of file hash_mm2a.cc.

References BLI_hash_mm2a_add().

Referenced by GPUCodegen::GPUCodegen(), and TEST().

◆ BLI_hash_mm2a_end()

◆ BLI_hash_mm2a_init()

◆ mm2a_mix_tail()

static void mm2a_mix_tail ( BLI_HashMurmur2A * mm2,
const uchar ** data,
size_t * len )
static