Contains functions used in the classic 64-bit xxHash algorithm.
- Note
- XXH3 provides competitive speed for both 32-bit and 64-bit systems, and offers true 64/128 bit hash results. It provides better speed for systems with vector processing capabilities.
◆ XXH64_createState
XXH_PUBLIC_API XXH64_state_t * XXH64_createState |
( |
|
void | ) |
XXH_NAME2(XXH_NAMESPACE, XXH64_createState) |
◆ XXH64_state_t
The opaque state struct for the XXH64 streaming API.
- See also
- XXH64_state_s for details.
◆ XXH64()
XXH_PUBLIC_API XXH64_hash_t XXH64 |
( |
XXH_NOESCAPE const void * |
input, |
|
|
size_t |
length, |
|
|
XXH64_hash_t |
seed |
|
) |
| |
Calculates the 64-bit hash of input
using xxHash64.
- Parameters
-
input | The block of data to be hashed, at least length bytes in size. |
length | The length of input , in bytes. |
seed | The 64-bit seed to alter the hash's output predictably. |
- Precondition
- The memory between
input
and input
+ length
must be valid, readable, contiguous memory. However, if length
is 0
, input
may be NULL
. In C++, this also must be TriviallyCopyable.
- Returns
- The calculated 64-bit xxHash64 value.
- See also
- Single Shot Example for an example.
◆ XXH64_canonicalFromHash()
XXH_PUBLIC_API void XXH64_canonicalFromHash |
( |
XXH_NOESCAPE XXH64_canonical_t * |
dst, |
|
|
XXH64_hash_t |
hash |
|
) |
| |
◆ XXH64_copyState()
Copies one XXH64_state_t to another.
- Parameters
-
dst_state | The state to copy to. |
src_state | The state to copy from. |
- Precondition
dst_state
and src_state
must not be NULL
and must not overlap.
◆ XXH64_digest()
XXH_PUBLIC_API XXH64_hash_t XXH64_digest |
( |
XXH_NOESCAPE const XXH64_state_t * |
statePtr | ) |
|
Returns the calculated hash value from an XXH64_state_t.
- Parameters
-
statePtr | The state struct to calculate the hash from. |
- Precondition
statePtr
must not be NULL
.
- Returns
- The calculated 64-bit xxHash64 value from that state.
- Note
- Calling XXH64_digest() will not affect
statePtr
, so you can update, digest, and update again.
◆ XXH64_freeState()
XXH_PUBLIC_API XXH_errorcode XXH64_freeState |
( |
XXH64_state_t * |
statePtr | ) |
|
◆ XXH64_hashFromCanonical()
XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical |
( |
XXH_NOESCAPE const XXH64_canonical_t * |
src | ) |
|
◆ XXH64_reset()
XXH_PUBLIC_API XXH_errorcode XXH64_reset |
( |
XXH_NOESCAPE XXH64_state_t * |
statePtr, |
|
|
XXH64_hash_t |
seed |
|
) |
| |
Resets an XXH64_state_t to begin a new hash.
- Parameters
-
statePtr | The state struct to reset. |
seed | The 64-bit seed to alter the hash result predictably. |
- Precondition
statePtr
must not be NULL
.
- Returns
- XXH_OK on success.
-
XXH_ERROR on failure.
- Note
- This function resets and seeds a state. Call it before XXH64_update().
◆ XXH64_update()
XXH_PUBLIC_API XXH_errorcode XXH64_update |
( |
XXH_NOESCAPE XXH64_state_t * |
statePtr, |
|
|
XXH_NOESCAPE const void * |
input, |
|
|
size_t |
length |
|
) |
| |
Consumes a block of input
to an XXH64_state_t.
- Parameters
-
statePtr | The state struct to update. |
input | The block of data to be hashed, at least length bytes in size. |
length | The length of input , in bytes. |
- Precondition
statePtr
must not be NULL
.
-
The memory between
input
and input
+ length
must be valid, readable, contiguous memory. However, if length
is 0
, input
may be NULL
. In C++, this also must be TriviallyCopyable.
- Returns
- XXH_OK on success.
-
XXH_ERROR on failure.
- Note
- Call this to incrementally consume blocks of data.