-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCityTest.cpp
34 lines (26 loc) · 957 Bytes
/
CityTest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "City.h"
#include "CityCrc.h"
void CityHash32_with_state_test ( const void * key, int len, const void *state, void * out )
{
*(uint32*)out = CityHash32WithSeed((const char *)key,len,*((uint32_t*)state));
}
void CityHash64_with_state_test ( const void * key, int len, const void *seed, void * out )
{
*(uint64*)out = CityHash64WithSeed((const char *)key,len,*((uint64_t*)seed));
}
#if defined(__SSE4_2__) && defined(__x86_64__)
void CityHash128_with_state_test ( const void * key, int len, const void *seed, void * out )
{
uint128 s(0,0);
s.first = ((uint64_t*)seed)[0];
s.second = ((uint64_t*)seed)[1];
*(uint128*)out = CityHash128WithSeed((const char*)key,len,s);
}
void CityHashCrc128_with_state_test ( const void * key, int len, const void *seed, void * out )
{
uint128 s(0,0);
s.first = ((uint64_t*)seed)[0];
s.second = ((uint64_t*)seed)[1];
*(uint128*)out = CityHashCrc128WithSeed((const char*)key,len,s);
}
#endif