| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#include "EXTERN.h" |
|
2
|
|
|
|
|
|
|
#include "perl.h" |
|
3
|
|
|
|
|
|
|
#include "XSUB.h" |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
#include "ppport.h" |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
/* define int64_t and uint64_t when using MinGW compiler */ |
|
8
|
|
|
|
|
|
|
#ifdef __MINGW32__ |
|
9
|
|
|
|
|
|
|
#include |
|
10
|
|
|
|
|
|
|
#endif |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
/* define int64_t and uint64_t when using MS compiler */ |
|
13
|
|
|
|
|
|
|
#ifdef _MSC_VER |
|
14
|
|
|
|
|
|
|
#include |
|
15
|
|
|
|
|
|
|
typedef __int64 int64_t; |
|
16
|
|
|
|
|
|
|
typedef unsigned __int64 uint64_t; |
|
17
|
|
|
|
|
|
|
#endif |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#include "xxhash.h" |
|
20
|
|
|
|
|
|
|
#include |
|
21
|
|
|
|
|
|
|
#include |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
MODULE = Crypt::xxHash PACKAGE = Crypt::xxHash |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
U32 |
|
28
|
|
|
|
|
|
|
xxhash32( const char *input, int length(input), UV seed ) |
|
29
|
|
|
|
|
|
|
CODE: |
|
30
|
12
|
|
|
|
|
|
RETVAL = XXH32(input, STRLEN_length_of_input, seed); |
|
31
|
|
|
|
|
|
|
OUTPUT: |
|
32
|
|
|
|
|
|
|
RETVAL |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
UV |
|
35
|
|
|
|
|
|
|
xxhash64( const char *input, int length(input), UV seed ) |
|
36
|
|
|
|
|
|
|
CODE: |
|
37
|
10
|
|
|
|
|
|
RETVAL = (UV) XXH64(input, STRLEN_length_of_input, seed); |
|
38
|
|
|
|
|
|
|
OUTPUT: |
|
39
|
|
|
|
|
|
|
RETVAL |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
UV |
|
42
|
|
|
|
|
|
|
xxhash3_64bits( const char *input, int length(input), UV seed ) |
|
43
|
|
|
|
|
|
|
CODE: |
|
44
|
2
|
|
|
|
|
|
RETVAL = (UV) XXH3_64bits_withSeed(input, STRLEN_length_of_input, seed); |
|
45
|
|
|
|
|
|
|
OUTPUT: |
|
46
|
|
|
|
|
|
|
RETVAL |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
char* |
|
49
|
|
|
|
|
|
|
xxhash32_hex ( const char *input, int length(input), UV seed ) |
|
50
|
|
|
|
|
|
|
CODE: |
|
51
|
|
|
|
|
|
|
static char value32[9]; |
|
52
|
1
|
|
|
|
|
|
sprintf(value32, "%08x", (uint32_t) XXH32(input, STRLEN_length_of_input, seed) ); |
|
53
|
|
|
|
|
|
|
RETVAL = value32; |
|
54
|
|
|
|
|
|
|
OUTPUT: |
|
55
|
|
|
|
|
|
|
RETVAL |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
char* |
|
58
|
|
|
|
|
|
|
xxhash64_hex( const char *input, int length(input), UV seed ) |
|
59
|
|
|
|
|
|
|
CODE: |
|
60
|
|
|
|
|
|
|
static char value64[17]; |
|
61
|
3
|
|
|
|
|
|
sprintf(value64, "%016"PRIx64, (uint64_t) XXH64(input, STRLEN_length_of_input, seed) ); |
|
62
|
|
|
|
|
|
|
RETVAL = value64; |
|
63
|
|
|
|
|
|
|
OUTPUT: |
|
64
|
|
|
|
|
|
|
RETVAL |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
char* |
|
67
|
|
|
|
|
|
|
xxhash3_64bits_hex( const char *input, int length(input), UV seed ) |
|
68
|
|
|
|
|
|
|
CODE: |
|
69
|
|
|
|
|
|
|
static char value64[17]; |
|
70
|
1
|
|
|
|
|
|
sprintf(value64, "%016"PRIx64, (uint64_t) XXH3_64bits_withSeed(input, STRLEN_length_of_input, seed) ); |
|
71
|
|
|
|
|
|
|
RETVAL = value64; |
|
72
|
|
|
|
|
|
|
OUTPUT: |
|
73
|
|
|
|
|
|
|
RETVAL |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
char* |
|
76
|
|
|
|
|
|
|
xxhash3_128bits_hex( const char *input, int length(input), UV seed ) |
|
77
|
|
|
|
|
|
|
CODE: |
|
78
|
|
|
|
|
|
|
static char value64[33]; |
|
79
|
1
|
|
|
|
|
|
XXH128_hash_t hash = XXH3_128bits_withSeed(input, STRLEN_length_of_input, seed); |
|
80
|
1
|
|
|
|
|
|
sprintf(value64, "%016"PRIx64"%016"PRIx64, (uint64_t) hash.high64, (uint64_t) hash.low64 ); |
|
81
|
|
|
|
|
|
|
RETVAL = value64; |
|
82
|
|
|
|
|
|
|
OUTPUT: |
|
83
|
|
|
|
|
|
|
RETVAL |
|
84
|
|
|
|
|
|
|
|