Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
hash-fct.C File Reference
#include <ctime>
#include <gsl/gsl_rng.h>
#include <stdexcept>
#include <mutex>
#include <shared_mutex>
#include <atomic>
#include "hash-fct.H"
#include <ah-errors.H>
Include dependency graph for hash-fct.C:

Go to the source code of this file.

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 

Macros

#define FORCE_INLINE   inline
 
#define ROTL32(x, y)   rotl32(x,y)
 
#define ROTL64(x, y)   rotl64(x,y)
 
#define BIG_CONSTANT(x)   (x##LLU)
 
#define getblock(p, i)   (p[i])
 
#define jen_mix(a, b, c)
 
#define jen_final(a, b, c)
 

Functions

static uint32_t Aleph::rotl32 (uint32_t x, int8_t r)
 
static uint64_t Aleph::rotl64 (uint64_t x, int8_t r)
 
static uint32_t Aleph::fmix32 (uint32_t h)
 
static uint64_t Aleph::fmix64 (uint64_t k)
 
static std::uint32_t Aleph::read_le32 (const std::uint8_t *p) noexcept
 
static std::uint64_t Aleph::read_le64 (const std::uint8_t *p) noexcept
 
static std::uint64_t Aleph::mul_xor_fold64 (std::uint64_t lhs, std::uint64_t rhs) noexcept
 
static std::uint64_t Aleph::xxh64_round (std::uint64_t acc, std::uint64_t input) noexcept
 
static std::uint64_t Aleph::xxh64_merge_round (std::uint64_t acc, std::uint64_t value) noexcept
 
static std::uint64_t Aleph::wyhash_mix (std::uint64_t lhs, std::uint64_t rhs) noexcept
 
static void Aleph::jsw_fill_table (std::uint32_t seed) noexcept
 
bool Aleph::is_jsw_initialized () noexcept
 Checks if the jsw_hash() lookup table has been initialized.
 
void Aleph::init_jsw () noexcept
 Initializes the randomized lookup table used by jsw_hash().
 
void Aleph::init_jsw (std::uint32_t seed) noexcept
 Initializes the randomized lookup table used by jsw_hash().
 
size_t Aleph::jsw_hash (const void *key, size_t len) noexcept
 JSW hash (Julienne Walker)
 
size_t Aleph::jsw_hash (const char *key) noexcept
 Compute a 32-bit JSW hash for a null-terminated string.
 
size_t Aleph::jen_hash (const void *key, size_t len, unsigned initval) noexcept
 Jenkins hash (lookup3)
 
void Aleph::MurmurHash3_x86_32 (const void *key, int len, uint32_t seed, void *out)
 
void Aleph::MurmurHash3_x86_128 (const void *key, const int len, uint32_t seed, void *out)
 
void Aleph::MurmurHash3_x64_128 (const void *key, const int len, const uint32_t seed, void *out)
 
size_t Aleph::xxhash64_hash (const void *key, size_t len, std::uint64_t seed=Default_Hash_Seed) noexcept
 xxHash64 from the xxHash family.
 
size_t Aleph::wyhash_hash (const void *key, size_t len, std::uint64_t seed=Default_Hash_Seed) noexcept
 wyhash non-cryptographic hash.
 
size_t Aleph::siphash24_hash (const void *key, size_t len, std::uint64_t key0=0x0706050403020100ULL, std::uint64_t key1=0x0f0e0d0c0b0a0908ULL) noexcept
 SipHash-2-4 keyed hash.
 

Variables

const unsigned Aleph::Default_Hash_Seed = 52679987
 
static long Aleph::tab [256]
 
static std::once_flag Aleph::jsw_init_flag
 
static std::atomic< boolAleph::init {false}
 
static std::shared_mutex Aleph::jsw_mtx
 

Macro Definition Documentation

◆ BIG_CONSTANT

#define BIG_CONSTANT (   x)    (x##LLU)

Definition at line 82 of file hash-fct.C.

◆ FORCE_INLINE

#define FORCE_INLINE   inline

Definition at line 66 of file hash-fct.C.

◆ getblock

#define getblock (   p,
 
)    (p[i])

Definition at line 88 of file hash-fct.C.

◆ jen_final

#define jen_final (   a,
  b,
 
)
Value:
{ \
c ^= b; c -= ROTL32(b,14); \
a ^= c; a -= ROTL32(c,11); \
b ^= a; b -= ROTL32(a,25); \
c ^= b; c -= ROTL32(b,16); \
a ^= c; a -= ROTL32(c,4); \
b ^= a; b -= ROTL32(a,14); \
c ^= b; c -= ROTL32(b,24); \
}
#define ROTL32(x, y)
Definition hash-fct.C:79

Definition at line 314 of file hash-fct.C.

◆ jen_mix

#define jen_mix (   a,
  b,
 
)
Value:
{ \
a -= c; a ^= ROTL32(c, 4); c += b; \
b -= a; b ^= ROTL32(a, 6); a += c; \
c -= b; c ^= ROTL32(b, 8); b += a; \
a -= c; a ^= ROTL32(c,16); c += b; \
b -= a; b ^= ROTL32(a,19); a += c; \
c -= b; c ^= ROTL32(b, 4); b += a; \
}

Definition at line 304 of file hash-fct.C.

◆ ROTL32

#define ROTL32 (   x,
  y 
)    rotl32(x,y)

Definition at line 79 of file hash-fct.C.

◆ ROTL64

#define ROTL64 (   x,
  y 
)    rotl64(x,y)

Definition at line 80 of file hash-fct.C.