xxHash
0.8.0
Extremely fast non-cryptographic hash function
|
Macros | |
#define | XXH_PRIME32_1 0x9E3779B1U |
#define | XXH_PRIME32_2 0x85EBCA77U |
#define | XXH_PRIME32_3 0xC2B2AE3DU |
#define | XXH_PRIME32_4 0x27D4EB2FU |
#define | XXH_PRIME32_5 0x165667B1U |
#define | XXH_get32bits(p) XXH_readLE32_align(p, align) |
Functions | |
static xxh_u32 | XXH32_round (xxh_u32 acc, xxh_u32 input) |
Normal stripe processing routine. More... | |
static xxh_u32 | XXH32_avalanche (xxh_u32 h32) |
Mixes all bits to finalize the hash. More... | |
static xxh_u32 | XXH32_finalize (xxh_u32 h32, const xxh_u8 *ptr, size_t len, XXH_alignment align) |
Processes the last 0-15 bytes of ptr . More... | |
static xxh_u32 | XXH32_endian_align (const xxh_u8 *input, size_t len, xxh_u32 seed, XXH_alignment align) |
The implementation for XXH32(). More... | |
#define XXH_PRIME32_1 0x9E3779B1U |
0b10011110001101110111100110110001
#define XXH_PRIME32_2 0x85EBCA77U |
0b10000101111010111100101001110111
#define XXH_PRIME32_3 0xC2B2AE3DU |
0b11000010101100101010111000111101
#define XXH_PRIME32_4 0x27D4EB2FU |
0b00100111110101001110101100101111
#define XXH_PRIME32_5 0x165667B1U |
0b00010110010101100110011110110001
|
static |
Normal stripe processing routine.
This shuffles the bits so that any bit from input
impacts several bits in acc
.
acc | The accumulator lane. |
input | The stripe of input to mix. |
|
static |
Mixes all bits to finalize the hash.
The final mix ensures that all input bits have a chance to impact any bit in the output digest, resulting in an unbiased distribution.
h32 | The hash to avalanche. |
|
static |
Processes the last 0-15 bytes of ptr
.
There may be up to 15 bytes remaining to consume from the input. This final stage will digest them to ensure that all input bytes are present in the final mix.
h32 | The hash to finalize. |
ptr | The pointer to the remaining input. |
len | The remaining length, modulo 16. |
align | Whether ptr is aligned. |
|
inlinestatic |