FastqPuri
Macros | Functions | Variables
city.c File Reference

functions for hashin strings, C translation of cityhash (C++, google) More...

#include <string.h>
#include "city.h"
#include <byteswap.h>
Include dependency graph for city.c:

Macros

#define uint32_in_expected_order(x)   (x)
 
#define uint64_in_expected_order(x)   (x)
 
#define LIKELY(x)   (x)
 
#define PERMUTE3(a, b, c)   do { std::swap(a, b); std::swap(a, c); } while (0)
 
#define PERMUTE3_32(a, b, c)   do { uint32_t t = a; a = c; c = b; b = t;} while (0)
 
#define PERMUTE3_64(a, b, c)   do { uint64 t = a; a = c; c = b; b = t;} while (0)
 

Functions

static uint64 UNALIGNED_LOAD64 (const char *p)
 
static uint32 UNALIGNED_LOAD32 (const char *p)
 
static uint64 Fetch64 (const char *p)
 
static uint32 Fetch32 (const char *p)
 
static uint32 fmix (uint32 h)
 
static uint32 Rotate32 (uint32 val, int shift)
 
static uint32 Mur (uint32 a, uint32 h)
 
static uint32 Hash32Len13to24 (const char *s, size_t len)
 
static uint32 Hash32Len0to4 (const char *s, size_t len)
 
static uint32 Hash32Len5to12 (const char *s, size_t len)
 
uint32 CityHash32 (const char *s, size_t len)
 
static uint64 Rotate (uint64 val, int shift)
 
static uint64 ShiftMix (uint64 val)
 
static uint64 HashLen16 (uint64 u, uint64 v)
 
static uint64 HashLen16_3a (uint64 u, uint64 v, uint64 mul)
 
static uint64 HashLen0to16 (const char *s, size_t len)
 
static uint64 HashLen17to32 (const char *s, size_t len)
 
uint128 WeakHashLen32WithSeeds (uint64 w, uint64 x, uint64 y, uint64 z, uint64 a, uint64 b)
 
uint128 WeakHashLen32WithSeeds_3a (const char *s, uint64 a, uint64 b)
 
static uint64 HashLen33to64 (const char *s, size_t len)
 
uint64 CityHash64 (const char *s, size_t len)
 
uint64 CityHash64WithSeed (const char *s, size_t len, uint64 seed)
 
uint64 CityHash64WithSeeds (const char *s, size_t len, uint64 seed0, uint64 seed1)
 
static uint128 CityMurmur (const char *s, size_t len, uint128 seed)
 
uint128 CityHash128WithSeed (const char *s, size_t len, uint128 seed)
 
uint128 CityHash128 (const char *s, size_t len)
 

Variables

static const uint64 k0 = 0xc3a5c85c97cb3127ULL
 
static const uint64 k1 = 0xb492b66fbe98f273ULL
 
static const uint64 k2 = 0x9ae16a3b2f90404fULL
 
static const uint32_t c1 = 0xcc9e2d51
 
static const uint32_t c2 = 0x1b873593
 

Detailed Description

functions for hashin strings, C translation of cityhash (C++, google)

Author
bdnt
See also
https://github.com/bdnt/cityhash-c
https://github.com/google/cityhash