line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#pragma once |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
#include |
4
|
|
|
|
|
|
|
#include |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
namespace panda { namespace hash { |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
uint64_t hash_murmur64a (const char* str, size_t len); |
9
|
|
|
|
|
|
|
uint32_t hash_jenkins_one_at_a_time (const char* str, size_t len); |
10
|
|
|
|
|
|
|
|
11
|
5338
|
|
|
|
|
|
inline uint64_t hash64 (const char* str, size_t len) { return hash_murmur64a(str, len); } |
12
|
|
|
|
|
|
|
inline uint32_t hash32 (const char* str, size_t len) { return hash_jenkins_one_at_a_time(str, len); } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
namespace { |
15
|
|
|
|
|
|
|
template struct _hashXX; |
16
|
|
|
|
|
|
|
template <> struct _hashXX<4> { uint32_t operator() (const char* str, size_t len) { return hash32(str, len); } }; |
17
|
5338
|
|
|
|
|
|
template <> struct _hashXX<8> { uint64_t operator() (const char* str, size_t len) { return hash64(str, len); } }; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
template inline T hashXX (const char* str, size_t len); |
21
|
|
|
|
|
|
|
template <> inline unsigned hashXX (const char* str, size_t len) { return _hashXX()(str, len); } |
22
|
2669
|
50
|
|
|
|
|
template <> inline unsigned long hashXX (const char* str, size_t len) { return _hashXX()(str, len); } |
23
|
|
|
|
|
|
|
template <> inline unsigned long long hashXX (const char* str, size_t len) { return _hashXX()(str, len); } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
inline uint64_t string_hash (const char* str, size_t len) { return hash64(str, len); } |
26
|
|
|
|
|
|
|
inline uint64_t string_hash (const char* str) { return string_hash(str, strlen(str)); } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
inline uint32_t string_hash32 (const char* str, size_t len) { return hash32(str, len); } |
29
|
|
|
|
|
|
|
inline uint32_t string_hash32 (const char* str) { return string_hash32(str, strlen(str)); } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
char* crypt_xor (const char* source, size_t slen, const char* key, size_t klen, char* dest = NULL); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
}} |