Defines | Functions

hash.cpp File Reference

#include "hash.h"
#include "crushwrapper.h"
Include dependency graph for hash.cpp:

Defines

#define crush_hashmix(a, b, c)
#define crush_hash_seed   1315423911

Functions

uint64_t disthash (VDRIVE::Distributor *crush_dist, int64_t key1)
uint64_t disthash_2 (VDRIVE::Distributor *crush_dist, int64_t key1, int64_t key2)
uint64_t disthash_3 (VDRIVE::Distributor *crush_dist, int64_t key1, int64_t key2, int64_t key3)
uint64_t disthash_4 (VDRIVE::Distributor *crush_dist, int64_t key1, int64_t key2, int64_t key3, int64_t key4)
uint64_t disthash_5 (VDRIVE::Distributor *crush_dist, int64_t key1, int64_t key2, int64_t key3, int64_t key4, int64_t key5)
uint32_t crush_hash32 (int type, uint32_t a)
uint32_t crush_hash32_2 (int type, uint32_t a, uint32_t b)
uint32_t crush_hash32_3 (int type, uint32_t a, uint32_t b, uint32_t c)
uint32_t crush_hash32_4 (int type, uint32_t a, uint32_t b, uint32_t c, uint32_t d)
uint32_t crush_hash32_5 (int type, uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t e)
const char * crush_hash_name (int type)

Define Documentation

#define crush_hash_seed   1315423911
#define crush_hashmix (   a,
  b,
 
)
Value:
do {                    \
                a = a-b;  a = a-c;  a = a^(c>>13);      \
                b = b-c;  b = b-a;  b = b^(a<<8);       \
                c = c-a;  c = c-b;  c = c^(b>>13);      \
                a = a-b;  a = a-c;  a = a^(c>>12);      \
                b = b-c;  b = b-a;  b = b^(a<<16);      \
                c = c-a;  c = c-b;  c = c^(b>>5);       \
                a = a-b;  a = a-c;  a = a^(c>>3);       \
                b = b-c;  b = b-a;  b = b^(a<<10);      \
                c = c-a;  c = c-b;  c = c^(b>>15);      \
        } while (0)

Function Documentation

uint32_t crush_hash32 ( int  type,
uint32_t  a 
)
uint32_t crush_hash32_2 ( int  type,
uint32_t  a,
uint32_t  b 
)
uint32_t crush_hash32_3 ( int  type,
uint32_t  a,
uint32_t  b,
uint32_t  c 
)
uint32_t crush_hash32_4 ( int  type,
uint32_t  a,
uint32_t  b,
uint32_t  c,
uint32_t  d 
)
uint32_t crush_hash32_5 ( int  type,
uint32_t  a,
uint32_t  b,
uint32_t  c,
uint32_t  d,
uint32_t  e 
)
const char* crush_hash_name ( int  type )
uint64_t disthash ( VDRIVE::Distributor crush_dist,
int64_t  key1 
)
uint64_t disthash_2 ( VDRIVE::Distributor crush_dist,
int64_t  key1,
int64_t  key2 
)
uint64_t disthash_3 ( VDRIVE::Distributor crush_dist,
int64_t  key1,
int64_t  key2,
int64_t  key3 
)
uint64_t disthash_4 ( VDRIVE::Distributor crush_dist,
int64_t  key1,
int64_t  key2,
int64_t  key3,
int64_t  key4 
)
uint64_t disthash_5 ( VDRIVE::Distributor crush_dist,
int64_t  key1,
int64_t  key2,
int64_t  key3,
int64_t  key4,
int64_t  key5 
)