libcute 0.1
Loading...
Searching...
No Matches
Macros | Functions
hash.h File Reference
#include <stddef.h>
#include <stdint.h>
Include dependency graph for hash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CU_FNV1A32_OFFSET_BASIS   2166136261u
 32-bit FNV-1a offset basis.
 
#define CU_FNV1A32_PRIME   16777619u
 32-bit FNV-1a prime.
 
#define CU_FNV1A64_OFFSET_BASIS   14695981039346656037ull
 64-bit FNV-1a offset basis.
 
#define CU_FNV1A64_PRIME   1099511628211ull
 64-bit FNV-1a prime.
 
#define CU_MURMUR3_C1   0xcc9e2d51u
 Murmur3 constant c1.
 
#define CU_MURMUR3_C2   0x1b873593u
 Murmur3 constant c2.
 
#define CU_MURMUR3_N   0xe6546b64u
 Murmur3 constant used during mixing.
 
#define CU_MURMUR3_F1   0x85ebca6bu
 Murmur3 finalization constant 1.
 
#define CU_MURMUR3_F2   0xc2b2ae35u
 Murmur3 finalization constant 2.
 
#define CU_SIPHASH_V0_INIT   0x736f6d6570736575ull
 SipHash initial v0 constant.
 
#define CU_SIPHASH_V1_INIT   0x646f72616e646f6dull
 SipHash initial v1 constant.
 
#define CU_SIPHASH_V2_INIT   0x6c7967656e657261ull
 SipHash initial v2 constant.
 
#define CU_SIPHASH_V3_INIT   0x7465646279746573ull
 SipHash initial v3 constant.
 

Functions

uint32_t cu_Hash_FNV1a32 (const void *data, size_t len)
 Compute a 32-bit FNV-1a hash.
 
uint64_t cu_Hash_FNV1a64 (const void *data, size_t len)
 Compute a 64-bit FNV-1a hash.
 
uint32_t cu_Hash_Murmur3_32 (const void *data, size_t len, uint32_t seed)
 Compute a 32-bit Murmur3 hash.
 
uint64_t cu_Hash_SipHash24 (const uint8_t key[16], const void *data, size_t len)
 Compute SipHash-2-4.
 

Detailed Description

Hashing utilities.

Function Documentation

◆ cu_Hash_FNV1a32()

uint32_t cu_Hash_FNV1a32 ( const void *  data,
size_t  len 
)

Compute a 32-bit FNV-1a hash.

Parameters
datainput bytes
lennumber of bytes

Compute the 32-bit FNV-1a hash of a buffer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cu_Hash_FNV1a64()

uint64_t cu_Hash_FNV1a64 ( const void *  data,
size_t  len 
)

Compute a 64-bit FNV-1a hash.

Compute the 64-bit FNV-1a hash of a buffer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cu_Hash_Murmur3_32()

uint32_t cu_Hash_Murmur3_32 ( const void *  data,
size_t  len,
uint32_t  seed 
)

Compute a 32-bit Murmur3 hash.

Compute the 32-bit Murmur3 hash of a buffer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cu_Hash_SipHash24()

uint64_t cu_Hash_SipHash24 ( const uint8_t  key[16],
const void *  data,
size_t  len 
)

Compute SipHash-2-4.

Compute SipHash-2-4 for the given input.

Here is the call graph for this function:
Here is the caller graph for this function: