libcute 0.1
Loading...
Searching...
No Matches
hash.h
Go to the documentation of this file.
1#pragma once
2
5#include <stddef.h>
6#include <stdint.h>
7
9#define CU_FNV1A32_OFFSET_BASIS 2166136261u
11#define CU_FNV1A32_PRIME 16777619u
12
14#define CU_FNV1A64_OFFSET_BASIS 14695981039346656037ull
16#define CU_FNV1A64_PRIME 1099511628211ull
17
19#define CU_MURMUR3_C1 0xcc9e2d51u
21#define CU_MURMUR3_C2 0x1b873593u
23#define CU_MURMUR3_N 0xe6546b64u
25#define CU_MURMUR3_F1 0x85ebca6bu
27#define CU_MURMUR3_F2 0xc2b2ae35u
28
30#define CU_SIPHASH_V0_INIT 0x736f6d6570736575ull
32#define CU_SIPHASH_V1_INIT 0x646f72616e646f6dull
34#define CU_SIPHASH_V2_INIT 0x6c7967656e657261ull
36#define CU_SIPHASH_V3_INIT 0x7465646279746573ull
37
44uint32_t cu_Hash_FNV1a32(const void *data, size_t len);
46uint64_t cu_Hash_FNV1a64(const void *data, size_t len);
47
49uint32_t cu_Hash_Murmur3_32(const void *data, size_t len, uint32_t seed);
50
52uint64_t cu_Hash_SipHash24(const uint8_t key[16], const void *data, size_t len);
uint32_t cu_Hash_FNV1a32(const void *data, size_t len)
Compute a 32-bit FNV-1a hash.
Definition hash.c:7
uint32_t cu_Hash_Murmur3_32(const void *data, size_t len, uint32_t seed)
Compute a 32-bit Murmur3 hash.
Definition hash.c:29
uint64_t cu_Hash_SipHash24(const uint8_t key[16], const void *data, size_t len)
Compute SipHash-2-4.
Definition hash.c:100
uint64_t cu_Hash_FNV1a64(const void *data, size_t len)
Compute a 64-bit FNV-1a hash.
Definition hash.c:18