![]() |
Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
|
#include <linux/types.h>
#include <asm/unaligned.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/xxhash.h>
Go to the source code of this file.
Data Structures | |
struct | xxh32_state |
struct | xxh64_state |
Macros | |
#define | XXH_API static inline __attribute__((unused)) |
#define | xxh_rotl32(x, r) |
#define | xxh_rotl64(x, r) |
#define | XXH_CPU_LITTLE_ENDIAN 0 |
Functions | |
XXH_API uint32_t | xxh32 (const void *input, size_t length, uint32_t seed) |
XXH_API uint64_t | xxh64 (const void *input, size_t length, uint64_t seed) |
XXH_API void | xxh32_reset (struct xxh32_state *state, uint32_t seed) |
XXH_API int | xxh32_update (struct xxh32_state *state, const void *input, size_t length) |
XXH_API uint32_t | xxh32_digest (const struct xxh32_state *state) |
XXH_API void | xxh64_reset (struct xxh64_state *state, uint64_t seed) |
XXH_API int | xxh64_update (struct xxh64_state *state, const void *input, size_t length) |
XXH_API uint64_t | xxh64_digest (const struct xxh64_state *state) |
XXH_API void | xxh32_copy_state (struct xxh32_state *dst, const struct xxh32_state *src) |
XXH_API void | xxh64_copy_state (struct xxh64_state *dst, const struct xxh64_state *src) |
#define XXH_API static inline __attribute__((unused)) |
#define XXH_CPU_LITTLE_ENDIAN 0 |
#define xxh_rotl32 | ( | x, | |
r ) |
#define xxh_rotl64 | ( | x, | |
r ) |
xxh32() - calculate the 32-bit hash of the input with a given seed.
@input: The data to hash. @length: The length of the data to hash. @seed: The seed can be used to alter the result predictably.
Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s
Return: The 32-bit hash of the data.
XXH_API void xxh32_copy_state | ( | struct xxh32_state * | dst, |
const struct xxh32_state * | src ) |
xxh32_copy_state() - copy the source state into the destination state
@src: The source xxh32 state. @dst: The destination xxh32 state.
XXH_API uint32_t xxh32_digest | ( | const struct xxh32_state * | state | ) |
xxh32_digest() - produce the current xxh32 hash
@state: Produce the current xxh32 hash of this state.
A hash value can be produced at any time. It is still possible to continue inserting input into the hash state after a call to xxh32_digest(), and generate new hashes later on, by calling xxh32_digest() again.
Return: The xxh32 hash stored in the state.
XXH_API void xxh32_reset | ( | struct xxh32_state * | state, |
uint32_t | seed ) |
xxh32_reset() - reset the xxh32 state to start a new hashing operation
@state: The xxh32 state to reset. @seed: Initialize the hash state with this seed.
Call this function on any xxh32_state to prepare for a new hashing operation.
XXH_API int xxh32_update | ( | struct xxh32_state * | state, |
const void * | input, | ||
size_t | length ) |
xxh32_update() - hash the data given and update the xxh32 state
@state: The xxh32 state to update. @input: The data to hash. @length: The length of the data to hash.
After calling xxh32_reset() call xxh32_update() as many times as necessary.
Return: Zero on success, otherwise an error code.
xxh64() - calculate the 64-bit hash of the input with a given seed.
@input: The data to hash. @length: The length of the data to hash. @seed: The seed can be used to alter the result predictably.
This function runs 2x faster on 64-bit systems, but slower on 32-bit systems.
Return: The 64-bit hash of the data.
XXH_API void xxh64_copy_state | ( | struct xxh64_state * | dst, |
const struct xxh64_state * | src ) |
xxh64_copy_state() - copy the source state into the destination state
@src: The source xxh64 state. @dst: The destination xxh64 state.
XXH_API uint64_t xxh64_digest | ( | const struct xxh64_state * | state | ) |
xxh64_digest() - produce the current xxh64 hash
@state: Produce the current xxh64 hash of this state.
A hash value can be produced at any time. It is still possible to continue inserting input into the hash state after a call to xxh64_digest(), and generate new hashes later on, by calling xxh64_digest() again.
Return: The xxh64 hash stored in the state.
XXH_API void xxh64_reset | ( | struct xxh64_state * | state, |
uint64_t | seed ) |
xxh64_reset() - reset the xxh64 state to start a new hashing operation
@state: The xxh64 state to reset. @seed: Initialize the hash state with this seed.
XXH_API int xxh64_update | ( | struct xxh64_state * | state, |
const void * | input, | ||
size_t | length ) |
xxh64_update() - hash the data given and update the xxh64 state @state: The xxh64 state to update. @input: The data to hash. @length: The length of the data to hash.
After calling xxh64_reset() call xxh64_update() as many times as necessary.
Return: Zero on success, otherwise an error code.