xref: /reactos/drivers/filesystems/btrfs/xxhash.h (revision 194ea909)
1*194ea909SVictor Perevertkin /*
2*194ea909SVictor Perevertkin    xxHash - Extremely Fast Hash algorithm
3*194ea909SVictor Perevertkin    Header File
4*194ea909SVictor Perevertkin    Copyright (C) 2012-2016, Yann Collet.
5*194ea909SVictor Perevertkin 
6*194ea909SVictor Perevertkin    BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
7*194ea909SVictor Perevertkin 
8*194ea909SVictor Perevertkin    Redistribution and use in source and binary forms, with or without
9*194ea909SVictor Perevertkin    modification, are permitted provided that the following conditions are
10*194ea909SVictor Perevertkin    met:
11*194ea909SVictor Perevertkin 
12*194ea909SVictor Perevertkin        * Redistributions of source code must retain the above copyright
13*194ea909SVictor Perevertkin    notice, this list of conditions and the following disclaimer.
14*194ea909SVictor Perevertkin        * Redistributions in binary form must reproduce the above
15*194ea909SVictor Perevertkin    copyright notice, this list of conditions and the following disclaimer
16*194ea909SVictor Perevertkin    in the documentation and/or other materials provided with the
17*194ea909SVictor Perevertkin    distribution.
18*194ea909SVictor Perevertkin 
19*194ea909SVictor Perevertkin    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20*194ea909SVictor Perevertkin    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21*194ea909SVictor Perevertkin    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22*194ea909SVictor Perevertkin    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23*194ea909SVictor Perevertkin    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24*194ea909SVictor Perevertkin    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25*194ea909SVictor Perevertkin    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26*194ea909SVictor Perevertkin    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27*194ea909SVictor Perevertkin    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28*194ea909SVictor Perevertkin    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29*194ea909SVictor Perevertkin    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30*194ea909SVictor Perevertkin 
31*194ea909SVictor Perevertkin    You can contact the author at :
32*194ea909SVictor Perevertkin    - xxHash source repository : https://github.com/Cyan4973/xxHash
33*194ea909SVictor Perevertkin */
34*194ea909SVictor Perevertkin 
35*194ea909SVictor Perevertkin /* Notice extracted from xxHash homepage :
36*194ea909SVictor Perevertkin 
37*194ea909SVictor Perevertkin xxHash is an extremely fast Hash algorithm, running at RAM speed limits.
38*194ea909SVictor Perevertkin It also successfully passes all tests from the SMHasher suite.
39*194ea909SVictor Perevertkin 
40*194ea909SVictor Perevertkin Comparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2 Duo @3GHz)
41*194ea909SVictor Perevertkin 
42*194ea909SVictor Perevertkin Name            Speed       Q.Score   Author
43*194ea909SVictor Perevertkin xxHash          5.4 GB/s     10
44*194ea909SVictor Perevertkin CrapWow         3.2 GB/s      2       Andrew
45*194ea909SVictor Perevertkin MumurHash 3a    2.7 GB/s     10       Austin Appleby
46*194ea909SVictor Perevertkin SpookyHash      2.0 GB/s     10       Bob Jenkins
47*194ea909SVictor Perevertkin SBox            1.4 GB/s      9       Bret Mulvey
48*194ea909SVictor Perevertkin Lookup3         1.2 GB/s      9       Bob Jenkins
49*194ea909SVictor Perevertkin SuperFastHash   1.2 GB/s      1       Paul Hsieh
50*194ea909SVictor Perevertkin CityHash64      1.05 GB/s    10       Pike & Alakuijala
51*194ea909SVictor Perevertkin FNV             0.55 GB/s     5       Fowler, Noll, Vo
52*194ea909SVictor Perevertkin CRC32           0.43 GB/s     9
53*194ea909SVictor Perevertkin MD5-32          0.33 GB/s    10       Ronald L. Rivest
54*194ea909SVictor Perevertkin SHA1-32         0.28 GB/s    10
55*194ea909SVictor Perevertkin 
56*194ea909SVictor Perevertkin Q.Score is a measure of quality of the hash function.
57*194ea909SVictor Perevertkin It depends on successfully passing SMHasher test set.
58*194ea909SVictor Perevertkin 10 is a perfect score.
59*194ea909SVictor Perevertkin 
60*194ea909SVictor Perevertkin A 64-bits version, named XXH64, is available since r35.
61*194ea909SVictor Perevertkin It offers much better speed, but for 64-bits applications only.
62*194ea909SVictor Perevertkin Name     Speed on 64 bits    Speed on 32 bits
63*194ea909SVictor Perevertkin XXH64       13.8 GB/s            1.9 GB/s
64*194ea909SVictor Perevertkin XXH32        6.8 GB/s            6.0 GB/s
65*194ea909SVictor Perevertkin */
66*194ea909SVictor Perevertkin 
67*194ea909SVictor Perevertkin #if defined (__cplusplus)
68*194ea909SVictor Perevertkin extern "C" {
69*194ea909SVictor Perevertkin #endif
70*194ea909SVictor Perevertkin 
71*194ea909SVictor Perevertkin #ifndef XXHASH_H_5627135585666179
72*194ea909SVictor Perevertkin #define XXHASH_H_5627135585666179 1
73*194ea909SVictor Perevertkin 
74*194ea909SVictor Perevertkin 
75*194ea909SVictor Perevertkin /* ****************************
76*194ea909SVictor Perevertkin *  Definitions
77*194ea909SVictor Perevertkin ******************************/
78*194ea909SVictor Perevertkin #include <stddef.h>   /* size_t */
79*194ea909SVictor Perevertkin typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
80*194ea909SVictor Perevertkin 
81*194ea909SVictor Perevertkin 
82*194ea909SVictor Perevertkin /* ****************************
83*194ea909SVictor Perevertkin *  API modifier
84*194ea909SVictor Perevertkin ******************************/
85*194ea909SVictor Perevertkin /** XXH_PRIVATE_API
86*194ea909SVictor Perevertkin *   This is useful if you want to include xxhash functions in `static` mode
87*194ea909SVictor Perevertkin *   in order to inline them, and remove their symbol from the public list.
88*194ea909SVictor Perevertkin *   Methodology :
89*194ea909SVictor Perevertkin *     #define XXH_PRIVATE_API
90*194ea909SVictor Perevertkin *     #include "xxhash.h"
91*194ea909SVictor Perevertkin *   `xxhash.c` is automatically included.
92*194ea909SVictor Perevertkin *   It's not useful to compile and link it as a separate module anymore.
93*194ea909SVictor Perevertkin */
94*194ea909SVictor Perevertkin #ifdef XXH_PRIVATE_API
95*194ea909SVictor Perevertkin #  ifndef XXH_STATIC_LINKING_ONLY
96*194ea909SVictor Perevertkin #    define XXH_STATIC_LINKING_ONLY
97*194ea909SVictor Perevertkin #  endif
98*194ea909SVictor Perevertkin #  if defined(__GNUC__)
99*194ea909SVictor Perevertkin #    define XXH_PUBLIC_API static __inline __attribute__((unused))
100*194ea909SVictor Perevertkin #  elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)
101*194ea909SVictor Perevertkin #    define XXH_PUBLIC_API static inline
102*194ea909SVictor Perevertkin #  elif defined(_MSC_VER)
103*194ea909SVictor Perevertkin #    define XXH_PUBLIC_API static __inline
104*194ea909SVictor Perevertkin #  else
105*194ea909SVictor Perevertkin #    define XXH_PUBLIC_API static   /* this version may generate warnings for unused static functions; disable the relevant warning */
106*194ea909SVictor Perevertkin #  endif
107*194ea909SVictor Perevertkin #else
108*194ea909SVictor Perevertkin #  define XXH_PUBLIC_API   /* do nothing */
109*194ea909SVictor Perevertkin #endif /* XXH_PRIVATE_API */
110*194ea909SVictor Perevertkin 
111*194ea909SVictor Perevertkin /*!XXH_NAMESPACE, aka Namespace Emulation :
112*194ea909SVictor Perevertkin 
113*194ea909SVictor Perevertkin If you want to include _and expose_ xxHash functions from within your own library,
114*194ea909SVictor Perevertkin but also want to avoid symbol collisions with another library which also includes xxHash,
115*194ea909SVictor Perevertkin 
116*194ea909SVictor Perevertkin you can use XXH_NAMESPACE, to automatically prefix any public symbol from xxhash library
117*194ea909SVictor Perevertkin with the value of XXH_NAMESPACE (so avoid to keep it NULL and avoid numeric values).
118*194ea909SVictor Perevertkin 
119*194ea909SVictor Perevertkin Note that no change is required within the calling program as long as it includes `xxhash.h` :
120*194ea909SVictor Perevertkin regular symbol name will be automatically translated by this header.
121*194ea909SVictor Perevertkin */
122*194ea909SVictor Perevertkin #ifdef XXH_NAMESPACE
123*194ea909SVictor Perevertkin #  define XXH_CAT(A,B) A##B
124*194ea909SVictor Perevertkin #  define XXH_NAME2(A,B) XXH_CAT(A,B)
125*194ea909SVictor Perevertkin #  define XXH32 XXH_NAME2(XXH_NAMESPACE, XXH32)
126*194ea909SVictor Perevertkin #  define XXH64 XXH_NAME2(XXH_NAMESPACE, XXH64)
127*194ea909SVictor Perevertkin #  define XXH_versionNumber XXH_NAME2(XXH_NAMESPACE, XXH_versionNumber)
128*194ea909SVictor Perevertkin #  define XXH32_createState XXH_NAME2(XXH_NAMESPACE, XXH32_createState)
129*194ea909SVictor Perevertkin #  define XXH64_createState XXH_NAME2(XXH_NAMESPACE, XXH64_createState)
130*194ea909SVictor Perevertkin #  define XXH32_freeState XXH_NAME2(XXH_NAMESPACE, XXH32_freeState)
131*194ea909SVictor Perevertkin #  define XXH64_freeState XXH_NAME2(XXH_NAMESPACE, XXH64_freeState)
132*194ea909SVictor Perevertkin #  define XXH32_reset XXH_NAME2(XXH_NAMESPACE, XXH32_reset)
133*194ea909SVictor Perevertkin #  define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)
134*194ea909SVictor Perevertkin #  define XXH32_update XXH_NAME2(XXH_NAMESPACE, XXH32_update)
135*194ea909SVictor Perevertkin #  define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update)
136*194ea909SVictor Perevertkin #  define XXH32_digest XXH_NAME2(XXH_NAMESPACE, XXH32_digest)
137*194ea909SVictor Perevertkin #  define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest)
138*194ea909SVictor Perevertkin #  define XXH32_copyState XXH_NAME2(XXH_NAMESPACE, XXH32_copyState)
139*194ea909SVictor Perevertkin #  define XXH64_copyState XXH_NAME2(XXH_NAMESPACE, XXH64_copyState)
140*194ea909SVictor Perevertkin #  define XXH32_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH32_canonicalFromHash)
141*194ea909SVictor Perevertkin #  define XXH64_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash)
142*194ea909SVictor Perevertkin #  define XXH32_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH32_hashFromCanonical)
143*194ea909SVictor Perevertkin #  define XXH64_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH64_hashFromCanonical)
144*194ea909SVictor Perevertkin #endif
145*194ea909SVictor Perevertkin 
146*194ea909SVictor Perevertkin 
147*194ea909SVictor Perevertkin /* *************************************
148*194ea909SVictor Perevertkin *  Version
149*194ea909SVictor Perevertkin ***************************************/
150*194ea909SVictor Perevertkin #define XXH_VERSION_MAJOR    0
151*194ea909SVictor Perevertkin #define XXH_VERSION_MINOR    6
152*194ea909SVictor Perevertkin #define XXH_VERSION_RELEASE  2
153*194ea909SVictor Perevertkin #define XXH_VERSION_NUMBER  (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE)
154*194ea909SVictor Perevertkin XXH_PUBLIC_API unsigned XXH_versionNumber (void);
155*194ea909SVictor Perevertkin 
156*194ea909SVictor Perevertkin 
157*194ea909SVictor Perevertkin /* ****************************
158*194ea909SVictor Perevertkin *  Simple Hash Functions
159*194ea909SVictor Perevertkin ******************************/
160*194ea909SVictor Perevertkin typedef unsigned int       XXH32_hash_t;
161*194ea909SVictor Perevertkin typedef unsigned long long XXH64_hash_t;
162*194ea909SVictor Perevertkin 
163*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed);
164*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed);
165*194ea909SVictor Perevertkin 
166*194ea909SVictor Perevertkin /*!
167*194ea909SVictor Perevertkin XXH32() :
168*194ea909SVictor Perevertkin     Calculate the 32-bits hash of sequence "length" bytes stored at memory address "input".
169*194ea909SVictor Perevertkin     The memory between input & input+length must be valid (allocated and read-accessible).
170*194ea909SVictor Perevertkin     "seed" can be used to alter the result predictably.
171*194ea909SVictor Perevertkin     Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s
172*194ea909SVictor Perevertkin XXH64() :
173*194ea909SVictor Perevertkin     Calculate the 64-bits hash of sequence of length "len" stored at memory address "input".
174*194ea909SVictor Perevertkin     "seed" can be used to alter the result predictably.
175*194ea909SVictor Perevertkin     This function runs 2x faster on 64-bits systems, but slower on 32-bits systems (see benchmark).
176*194ea909SVictor Perevertkin */
177*194ea909SVictor Perevertkin 
178*194ea909SVictor Perevertkin 
179*194ea909SVictor Perevertkin /* ****************************
180*194ea909SVictor Perevertkin *  Streaming Hash Functions
181*194ea909SVictor Perevertkin ******************************/
182*194ea909SVictor Perevertkin typedef struct XXH32_state_s XXH32_state_t;   /* incomplete type */
183*194ea909SVictor Perevertkin typedef struct XXH64_state_s XXH64_state_t;   /* incomplete type */
184*194ea909SVictor Perevertkin 
185*194ea909SVictor Perevertkin /*! State allocation, compatible with dynamic libraries */
186*194ea909SVictor Perevertkin 
187*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void);
188*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH_errorcode  XXH32_freeState(XXH32_state_t* statePtr);
189*194ea909SVictor Perevertkin 
190*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void);
191*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH_errorcode  XXH64_freeState(XXH64_state_t* statePtr);
192*194ea909SVictor Perevertkin 
193*194ea909SVictor Perevertkin 
194*194ea909SVictor Perevertkin /* hash streaming */
195*194ea909SVictor Perevertkin 
196*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH_errorcode XXH32_reset  (XXH32_state_t* statePtr, unsigned int seed);
197*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);
198*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH32_hash_t  XXH32_digest (const XXH32_state_t* statePtr);
199*194ea909SVictor Perevertkin 
200*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH_errorcode XXH64_reset  (XXH64_state_t* statePtr, unsigned long long seed);
201*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length);
202*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH64_hash_t  XXH64_digest (const XXH64_state_t* statePtr);
203*194ea909SVictor Perevertkin 
204*194ea909SVictor Perevertkin /*
205*194ea909SVictor Perevertkin These functions generate the xxHash of an input provided in multiple segments.
206*194ea909SVictor Perevertkin Note that, for small input, they are slower than single-call functions, due to state management.
207*194ea909SVictor Perevertkin For small input, prefer `XXH32()` and `XXH64()` .
208*194ea909SVictor Perevertkin 
209*194ea909SVictor Perevertkin XXH state must first be allocated, using XXH*_createState() .
210*194ea909SVictor Perevertkin 
211*194ea909SVictor Perevertkin Start a new hash by initializing state with a seed, using XXH*_reset().
212*194ea909SVictor Perevertkin 
213*194ea909SVictor Perevertkin Then, feed the hash state by calling XXH*_update() as many times as necessary.
214*194ea909SVictor Perevertkin Obviously, input must be allocated and read accessible.
215*194ea909SVictor Perevertkin The function returns an error code, with 0 meaning OK, and any other value meaning there is an error.
216*194ea909SVictor Perevertkin 
217*194ea909SVictor Perevertkin Finally, a hash value can be produced anytime, by using XXH*_digest().
218*194ea909SVictor Perevertkin This function returns the nn-bits hash as an int or long long.
219*194ea909SVictor Perevertkin 
220*194ea909SVictor Perevertkin It's still possible to continue inserting input into the hash state after a digest,
221*194ea909SVictor Perevertkin and generate some new hashes later on, by calling again XXH*_digest().
222*194ea909SVictor Perevertkin 
223*194ea909SVictor Perevertkin When done, free XXH state space if it was allocated dynamically.
224*194ea909SVictor Perevertkin */
225*194ea909SVictor Perevertkin 
226*194ea909SVictor Perevertkin 
227*194ea909SVictor Perevertkin /* **************************
228*194ea909SVictor Perevertkin *  Utils
229*194ea909SVictor Perevertkin ****************************/
230*194ea909SVictor Perevertkin #if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))   /* ! C99 */
231*194ea909SVictor Perevertkin #  define restrict   /* disable restrict */
232*194ea909SVictor Perevertkin #endif
233*194ea909SVictor Perevertkin 
234*194ea909SVictor Perevertkin XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* restrict dst_state, const XXH32_state_t* restrict src_state);
235*194ea909SVictor Perevertkin XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* restrict dst_state, const XXH64_state_t* restrict src_state);
236*194ea909SVictor Perevertkin 
237*194ea909SVictor Perevertkin 
238*194ea909SVictor Perevertkin /* **************************
239*194ea909SVictor Perevertkin *  Canonical representation
240*194ea909SVictor Perevertkin ****************************/
241*194ea909SVictor Perevertkin /* Default result type for XXH functions are primitive unsigned 32 and 64 bits.
242*194ea909SVictor Perevertkin *  The canonical representation uses human-readable write convention, aka big-endian (large digits first).
243*194ea909SVictor Perevertkin *  These functions allow transformation of hash result into and from its canonical format.
244*194ea909SVictor Perevertkin *  This way, hash values can be written into a file / memory, and remain comparable on different systems and programs.
245*194ea909SVictor Perevertkin */
246*194ea909SVictor Perevertkin typedef struct { unsigned char digest[4]; } XXH32_canonical_t;
247*194ea909SVictor Perevertkin typedef struct { unsigned char digest[8]; } XXH64_canonical_t;
248*194ea909SVictor Perevertkin 
249*194ea909SVictor Perevertkin XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash);
250*194ea909SVictor Perevertkin XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash);
251*194ea909SVictor Perevertkin 
252*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src);
253*194ea909SVictor Perevertkin XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src);
254*194ea909SVictor Perevertkin 
255*194ea909SVictor Perevertkin #endif /* XXHASH_H_5627135585666179 */
256*194ea909SVictor Perevertkin 
257*194ea909SVictor Perevertkin 
258*194ea909SVictor Perevertkin 
259*194ea909SVictor Perevertkin /* ================================================================================================
260*194ea909SVictor Perevertkin    This section contains definitions which are not guaranteed to remain stable.
261*194ea909SVictor Perevertkin    They may change in future versions, becoming incompatible with a different version of the library.
262*194ea909SVictor Perevertkin    They shall only be used with static linking.
263*194ea909SVictor Perevertkin    Never use these definitions in association with dynamic linking !
264*194ea909SVictor Perevertkin =================================================================================================== */
265*194ea909SVictor Perevertkin #if defined(XXH_STATIC_LINKING_ONLY) && !defined(XXH_STATIC_H_3543687687345)
266*194ea909SVictor Perevertkin #define XXH_STATIC_H_3543687687345
267*194ea909SVictor Perevertkin 
268*194ea909SVictor Perevertkin /* These definitions are only meant to allow allocation of XXH state
269*194ea909SVictor Perevertkin    statically, on stack, or in a struct for example.
270*194ea909SVictor Perevertkin    Do not use members directly. */
271*194ea909SVictor Perevertkin 
272*194ea909SVictor Perevertkin    struct XXH32_state_s {
273*194ea909SVictor Perevertkin        unsigned total_len_32;
274*194ea909SVictor Perevertkin        unsigned large_len;
275*194ea909SVictor Perevertkin        unsigned v1;
276*194ea909SVictor Perevertkin        unsigned v2;
277*194ea909SVictor Perevertkin        unsigned v3;
278*194ea909SVictor Perevertkin        unsigned v4;
279*194ea909SVictor Perevertkin        unsigned mem32[4];   /* buffer defined as U32 for alignment */
280*194ea909SVictor Perevertkin        unsigned memsize;
281*194ea909SVictor Perevertkin        unsigned reserved;   /* never read nor write, will be removed in a future version */
282*194ea909SVictor Perevertkin    };   /* typedef'd to XXH32_state_t */
283*194ea909SVictor Perevertkin 
284*194ea909SVictor Perevertkin    struct XXH64_state_s {
285*194ea909SVictor Perevertkin        unsigned long long total_len;
286*194ea909SVictor Perevertkin        unsigned long long v1;
287*194ea909SVictor Perevertkin        unsigned long long v2;
288*194ea909SVictor Perevertkin        unsigned long long v3;
289*194ea909SVictor Perevertkin        unsigned long long v4;
290*194ea909SVictor Perevertkin        unsigned long long mem64[4];   /* buffer defined as U64 for alignment */
291*194ea909SVictor Perevertkin        unsigned memsize;
292*194ea909SVictor Perevertkin        unsigned reserved[2];          /* never read nor write, will be removed in a future version */
293*194ea909SVictor Perevertkin    };   /* typedef'd to XXH64_state_t */
294*194ea909SVictor Perevertkin 
295*194ea909SVictor Perevertkin 
296*194ea909SVictor Perevertkin #  ifdef XXH_PRIVATE_API
297*194ea909SVictor Perevertkin #    include "xxhash.c"   /* include xxhash functions as `static`, for inlining */
298*194ea909SVictor Perevertkin #  endif
299*194ea909SVictor Perevertkin 
300*194ea909SVictor Perevertkin #endif /* XXH_STATIC_LINKING_ONLY && XXH_STATIC_H_3543687687345 */
301*194ea909SVictor Perevertkin 
302*194ea909SVictor Perevertkin 
303*194ea909SVictor Perevertkin #if defined (__cplusplus)
304*194ea909SVictor Perevertkin }
305*194ea909SVictor Perevertkin #endif
306