mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 10:52:30 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
21 lines
613 B
C++
21 lines
613 B
C++
#include <IO/HashingWriteBuffer.h>
|
|
#include <IO/WriteBufferFromFile.h>
|
|
|
|
#define FAIL(msg) do { std::cout << msg; exit(1); } while (false)
|
|
|
|
|
|
static CityHash_v1_0_2::uint128 referenceHash(const char * data, size_t len)
|
|
{
|
|
const size_t block_size = DBMS_DEFAULT_HASHING_BLOCK_SIZE;
|
|
CityHash_v1_0_2::uint128 state(0, 0);
|
|
size_t pos;
|
|
|
|
for (pos = 0; pos + block_size <= len; pos += block_size)
|
|
state = CityHash_v1_0_2::CityHash128WithSeed(data + pos, block_size, state);
|
|
|
|
if (pos < len)
|
|
state = CityHash_v1_0_2::CityHash128WithSeed(data + pos, len - pos, state);
|
|
|
|
return state;
|
|
}
|