blob: 836ccfcc8513243647669ed84fc3271dc3b19180 (
plain) (
blame)
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
|
#include "common.h"
namespace {
#include "farmhashte.cc"
}
namespace farmhashnt {
#if !can_use_sse41 || !x86_64
uint32_t Hash32(const char *s, size_t len) {
FARMHASH_DIE_IF_MISCONFIGURED;
return s == NULL ? 0 : len;
}
uint32_t Hash32WithSeed(const char *s, size_t len, uint32_t seed) {
FARMHASH_DIE_IF_MISCONFIGURED;
return seed + Hash32(s, len);
}
#else
uint32_t Hash32(const char *s, size_t len) {
return static_cast<uint32_t>(farmhashte::Hash64(s, len));
}
uint32_t Hash32WithSeed(const char *s, size_t len, uint32_t seed) {
return static_cast<uint32_t>(farmhashte::Hash64WithSeed(s, len, seed));
}
#endif
} // namespace farmhashnt
|