-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
7,297 additions
and
200 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 was deleted.
Oops, something went wrong.
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 @@ | ||
../xxHash-0.8.2 |
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 |
---|---|---|
@@ -1,22 +1,8 @@ | ||
#ifndef HS_HASHABLE_H | ||
#define HS_HASHABLE_H | ||
|
||
#include "MachDeps.h" | ||
#include <stdint.h> | ||
|
||
#if WORD_SIZE_IN_BITS == 64 | ||
#define FNV_PRIME 1099511628211 | ||
#define FNV_SIGNED int64_t | ||
#define FNV_UNSIGNED uint64_t | ||
#else | ||
#define FNV_PRIME 16777619 | ||
#define FNV_SIGNED int32_t | ||
#define FNV_UNSIGNED uint32_t | ||
#endif | ||
|
||
uint64_t hs_hashable_init(); | ||
|
||
FNV_UNSIGNED hashable_fnv_hash(const unsigned char* str, FNV_SIGNED len, FNV_UNSIGNED salt); | ||
FNV_UNSIGNED hashable_fnv_hash_offset(const unsigned char* str, FNV_SIGNED offset, FNV_SIGNED len, FNV_UNSIGNED salt); | ||
|
||
#endif |
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,35 @@ | ||
#ifndef HS_XXHASH_H | ||
#define HS_XXHASH_H | ||
|
||
#include <stdint.h> | ||
|
||
#define XXH_INLINE_ALL | ||
#include "xxhash.h" | ||
|
||
#define hs_XXH3_sizeof_state_s sizeof(struct XXH3_state_s) | ||
|
||
static inline uint64_t hs_XXH3_64bits_withSeed_offset(const uint8_t *ptr, size_t off, size_t len, uint64_t seed) { | ||
return XXH3_64bits_withSeed(ptr + off, len, seed); | ||
} | ||
|
||
static inline uint64_t hs_XXH3_64bits_withSeed_u64(uint64_t val, uint64_t seed) { | ||
return XXH3_64bits_withSeed(&val, sizeof(val), seed); | ||
} | ||
|
||
static inline uint64_t hs_XXH3_64bits_withSeed_u32(uint32_t val, uint64_t seed) { | ||
return XXH3_64bits_withSeed(&val, sizeof(val), seed); | ||
} | ||
|
||
static inline void hs_XXH3_64bits_update_offset(XXH3_state_t *statePtr, const uint8_t *ptr, size_t off, size_t len) { | ||
XXH3_64bits_update(statePtr, ptr + off, len); | ||
} | ||
|
||
static inline void hs_XXH3_64bits_update_u64(XXH3_state_t *statePtr, uint64_t val) { | ||
XXH3_64bits_update(statePtr, &val, sizeof(val)); | ||
} | ||
|
||
static inline void hs_XXH3_64bits_update_u32(XXH3_state_t *statePtr, uint32_t val) { | ||
XXH3_64bits_update(statePtr, &val, sizeof(val)); | ||
} | ||
|
||
#endif /* HS_XXHASH_H */ |
Oops, something went wrong.