-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Google FarmHash, deprecating CityHash
good quality and speed. best hash funcs overall. Note that the speed in these docs is measured on a slow machine. I took the Speed result from my mac air laptop. Need to redo all the Speed tests again.
- Loading branch information
Reini Urban
committed
Jun 17, 2015
1 parent
b68a5e6
commit 0414c0c
Showing
10 changed files
with
9,487 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* We have conflicting uint128_t types in Types.h (Blob<128>) and farmhash.h */ | ||
|
||
#undef FARMHASH_UINT128_T_DEFINED | ||
#include "farmhash.h" | ||
|
||
void FarmHash32_test ( const void * key, int len, uint32_t seed, void * out ) { | ||
using namespace NAMESPACE_FOR_HASH_FUNCTIONS; | ||
*(uint32_t*)out = Hash32WithSeed((const char *)key,(size_t)len,seed); | ||
} | ||
void FarmHash64_test ( const void * key, int len, uint32_t seed, void * out ) { | ||
using namespace NAMESPACE_FOR_HASH_FUNCTIONS; | ||
*(uint64_t*)out = Hash64WithSeed((const char *)key,(size_t)len,(uint64_t)seed); | ||
} | ||
void FarmHash128_test ( const void * key, int len, uint32_t seed, void * out ) { | ||
using namespace NAMESPACE_FOR_HASH_FUNCTIONS; | ||
uint128_t s((uint64_t)seed, (uint64_t)0UL); | ||
uint128_t result = Hash128WithSeed((const char *)key, (size_t)len, s); | ||
memcpy(out, &result, 128/8); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.