php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
PMurHash.c File Reference
#include "PMurHash.h"
#include "endianness.h"

Go to the source code of this file.

Macros

#define FORCE_INLINE   static inline __attribute__((always_inline))
 
#define ROTL32(x, r)
 
#define READ_UINT32(ptr)
 
#define doblock(h1, k1)
 
#define dobytes(cnt, h1, c, n, ptr, len)
 

Functions

void PMurHash32_Process (uint32_t *ph1, uint32_t *pcarry, const void *key, int len)
 
uint32_t PMurHash32_Result (uint32_t h, uint32_t carry, uint32_t total_length)
 

Macro Definition Documentation

◆ doblock

#define doblock ( h1,
k1 )
Value:
do {\
k1 *= kC1;\
k1 = ROTL32(k1,15);\
k1 *= kC2;\
\
h1 ^= k1;\
h1 = ROTL32(h1,13);\
h1 = h1*5+0xe6546b64;\
} while(0)
#define ROTL32(s, v)
Definition hash_md.c:113

Definition at line 93 of file PMurHash.c.

◆ dobytes

#define dobytes ( cnt,
h1,
c,
n,
ptr,
len )
Value:
do {\
unsigned __cnt = cnt;\
while(__cnt--) {\
c = c>>8 | (uint32_t)*ptr++<<24;\
n++; len--;\
if(n==4) {\
doblock(h1, c);\
n = 0;\
}\
}\
} while(0)
size_t len
Definition apprentice.c:174
zend_long n
Definition ffi.c:4979
void * ptr
Definition ffi.c:3814

Definition at line 106 of file PMurHash.c.

◆ FORCE_INLINE

#define FORCE_INLINE   static inline __attribute__((always_inline))

Definition at line 76 of file PMurHash.c.

◆ READ_UINT32

#define READ_UINT32 ( ptr)
Value:
getblock32((uint32_t *)ptr, 0)
NO_SANITIZE_ALIGNMENT FORCE_INLINE uint32_t getblock32(const uint32_t *const p, const int i)
Definition endianness.h:65

Definition at line 83 of file PMurHash.c.

◆ ROTL32

#define ROTL32 ( x,
r )
Value:
(((uint32_t)x << r) | ((uint32_t)x >> (32 - r)))

Definition at line 78 of file PMurHash.c.

Function Documentation

◆ PMurHash32_Process()

void PMurHash32_Process ( uint32_t * ph1,
uint32_t * pcarry,
const void * key,
int len )

Definition at line 123 of file PMurHash.c.

◆ PMurHash32_Result()

uint32_t PMurHash32_Result ( uint32_t h,
uint32_t carry,
uint32_t total_length )

Definition at line 208 of file PMurHash.c.