Blender V5.3
hash_mm2a.cc File Reference

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Macros

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

Functions

static void blender::mm2a_mix_tail (BLI_HashMurmur2A *mm2, const uchar **data, size_t *len)
void blender::BLI_hash_mm2a_init (BLI_HashMurmur2A *mm2, uint32_t seed)
void blender::BLI_hash_mm2a_add (BLI_HashMurmur2A *mm2, const unsigned char *data, size_t len)
void blender::BLI_hash_mm2a_add_int (BLI_HashMurmur2A *mm2, int data)
uint32_t blender::BLI_hash_mm2a_end (BLI_HashMurmur2A *mm2)
uint32_t blender::BLI_hash_mm2 (const unsigned char *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 28 of file hash_mm2a.cc.

Referenced by blender::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:28

Definition at line 30 of file hash_mm2a.cc.

Referenced by blender::BLI_hash_mm2(), blender::BLI_hash_mm2a_add(), blender::BLI_hash_mm2a_end(), and blender::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 39 of file hash_mm2a.cc.

Referenced by blender::BLI_hash_mm2(), and blender::BLI_hash_mm2a_end().