Ninja
Macros | Functions | Variables
rapidhash.h File Reference
#include <stdint.h>
#include <string.h>
Include dependency graph for rapidhash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _likely_(x)   (x)
 
#define _unlikely_(x)   (x)
 
#define RAPID_SEED   (0xbdd89aa982704029ull)
 
#define RAPIDHASH_CONSTEXPR   static const
 
#define RAPIDHASH_FAST
 
#define RAPIDHASH_INLINE   static inline
 
#define RAPIDHASH_LITTLE_ENDIAN
 
#define RAPIDHASH_NOEXCEPT
 
#define RAPIDHASH_UNROLLED
 

Functions

RAPIDHASH_INLINE uint64_t rapid_mix (uint64_t A, uint64_t B) RAPIDHASH_NOEXCEPT
 
RAPIDHASH_INLINE void rapid_mum (uint64_t *A, uint64_t *B) RAPIDHASH_NOEXCEPT
 
RAPIDHASH_INLINE uint64_t rapid_read32 (const uint8_t *p) RAPIDHASH_NOEXCEPT
 
RAPIDHASH_INLINE uint64_t rapid_read64 (const uint8_t *p) RAPIDHASH_NOEXCEPT
 
RAPIDHASH_INLINE uint64_t rapid_readSmall (const uint8_t *p, size_t k) RAPIDHASH_NOEXCEPT
 
RAPIDHASH_INLINE uint64_t rapidhash (const void *key, size_t len) RAPIDHASH_NOEXCEPT
 
RAPIDHASH_INLINE uint64_t rapidhash_internal (const void *key, size_t len, uint64_t seed, const uint64_t *secret) RAPIDHASH_NOEXCEPT
 
RAPIDHASH_INLINE uint64_t rapidhash_withSeed (const void *key, size_t len, uint64_t seed) RAPIDHASH_NOEXCEPT
 

Variables

RAPIDHASH_CONSTEXPR uint64_t rapid_secret [3] = {0x2d358dccaa6c78a5ull, 0x8bb84b93962eacc9ull, 0x4b33a62ed433d4a3ull}
 

Macro Definition Documentation

◆ _likely_

#define _likely_ (   x)    (x)

Definition at line 102 of file rapidhash.h.

◆ _unlikely_

#define _unlikely_ (   x)    (x)

Definition at line 103 of file rapidhash.h.

◆ RAPID_SEED

#define RAPID_SEED   (0xbdd89aa982704029ull)

Definition at line 123 of file rapidhash.h.

◆ RAPIDHASH_CONSTEXPR

#define RAPIDHASH_CONSTEXPR   static const

Definition at line 61 of file rapidhash.h.

◆ RAPIDHASH_FAST

#define RAPIDHASH_FAST

Definition at line 74 of file rapidhash.h.

◆ RAPIDHASH_INLINE

#define RAPIDHASH_INLINE   static inline

Definition at line 63 of file rapidhash.h.

◆ RAPIDHASH_LITTLE_ENDIAN

#define RAPIDHASH_LITTLE_ENDIAN

Definition at line 116 of file rapidhash.h.

◆ RAPIDHASH_NOEXCEPT

#define RAPIDHASH_NOEXCEPT

Definition at line 60 of file rapidhash.h.

◆ RAPIDHASH_UNROLLED

#define RAPIDHASH_UNROLLED

Definition at line 90 of file rapidhash.h.

Function Documentation

◆ rapid_mix()

RAPIDHASH_INLINE uint64_t rapid_mix ( uint64_t  A,
uint64_t  B 
)

Definition at line 196 of file rapidhash.h.

References rapid_mum().

Referenced by rapidhash_internal().

◆ rapid_mum()

RAPIDHASH_INLINE void rapid_mum ( uint64_t A,
uint64_t B 
)

Definition at line 146 of file rapidhash.h.

Referenced by rapid_mix(), and rapidhash_internal().

◆ rapid_read32()

RAPIDHASH_INLINE uint64_t rapid_read32 ( const uint8_t *  p)

Definition at line 203 of file rapidhash.h.

Referenced by rapidhash_internal().

◆ rapid_read64()

RAPIDHASH_INLINE uint64_t rapid_read64 ( const uint8_t *  p)

Definition at line 202 of file rapidhash.h.

Referenced by rapidhash_internal().

◆ rapid_readSmall()

RAPIDHASH_INLINE uint64_t rapid_readSmall ( const uint8_t *  p,
size_t  k 
)

Definition at line 232 of file rapidhash.h.

Referenced by rapidhash_internal().

◆ rapidhash()

RAPIDHASH_INLINE uint64_t rapidhash ( const void *  key,
size_t  len 
)

◆ rapidhash_internal()

RAPIDHASH_INLINE uint64_t rapidhash_internal ( const void *  key,
size_t  len,
uint64_t  seed,
const uint64_t secret 
)

◆ rapidhash_withSeed()

RAPIDHASH_INLINE uint64_t rapidhash_withSeed ( const void *  key,
size_t  len,
uint64_t  seed 
)

Definition at line 307 of file rapidhash.h.

References rapid_secret, and rapidhash_internal().

Referenced by rapidhash().

Variable Documentation

◆ rapid_secret

RAPIDHASH_CONSTEXPR uint64_t rapid_secret[3] = {0x2d358dccaa6c78a5ull, 0x8bb84b93962eacc9ull, 0x4b33a62ed433d4a3ull}

Definition at line 128 of file rapidhash.h.

Referenced by rapidhash_withSeed().