openMSX
Classes | Functions | Variables
xxhash.hh File Reference
#include <bit>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <string_view>
Include dependency graph for xxhash.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  XXHasher
 
struct  XXHasher_IgnoreCase
 

Functions

template<bool ALIGNED>
uint32_t read32 (const uint8_t *ptr)
 
template<bool ALIGNED, uint8_t MASK8 = 0xFF, uint32_t SEED = 0>
uint32_t xxhash_impl (const uint8_t *p, size_t size)
 
template<uint8_t MASK8>
uint32_t xxhash_impl (std::string_view key)
 
uint32_t xxhash (std::string_view key)
 
uint32_t xxhash_case (std::string_view key)
 

Variables

constexpr uint32_t PRIME32_1 = 2654435761
 
constexpr uint32_t PRIME32_2 = 2246822519
 
constexpr uint32_t PRIME32_3 = 3266489917
 
constexpr uint32_t PRIME32_4 = 668265263
 
constexpr uint32_t PRIME32_5 = 374761393
 

Function Documentation

◆ read32()

template<bool ALIGNED>
uint32_t read32 ( const uint8_t *  ptr)
inline

Definition at line 59 of file xxhash.hh.

◆ xxhash()

uint32_t xxhash ( std::string_view  key)
inline

◆ xxhash_case()

uint32_t xxhash_case ( std::string_view  key)
inline

Definition at line 143 of file xxhash.hh.

Referenced by XXHasher_IgnoreCase::operator()().

◆ xxhash_impl() [1/2]

template<bool ALIGNED, uint8_t MASK8 = 0xFF, uint32_t SEED = 0>
uint32_t xxhash_impl ( const uint8_t *  p,
size_t  size 
)
inline

Definition at line 75 of file xxhash.hh.

References PRIME32_1, PRIME32_2, PRIME32_3, PRIME32_4, PRIME32_5, and v4.

◆ xxhash_impl() [2/2]

template<uint8_t MASK8>
uint32_t xxhash_impl ( std::string_view  key)
inline

Definition at line 127 of file xxhash.hh.

Variable Documentation

◆ PRIME32_1

constexpr uint32_t PRIME32_1 = 2654435761
inlineconstexpr

Definition at line 51 of file xxhash.hh.

Referenced by xxhash_impl().

◆ PRIME32_2

constexpr uint32_t PRIME32_2 = 2246822519
inlineconstexpr

Definition at line 52 of file xxhash.hh.

Referenced by xxhash_impl().

◆ PRIME32_3

constexpr uint32_t PRIME32_3 = 3266489917
inlineconstexpr

Definition at line 53 of file xxhash.hh.

Referenced by xxhash_impl().

◆ PRIME32_4

constexpr uint32_t PRIME32_4 = 668265263
inlineconstexpr

Definition at line 54 of file xxhash.hh.

Referenced by xxhash_impl().

◆ PRIME32_5

constexpr uint32_t PRIME32_5 = 374761393
inlineconstexpr

Definition at line 55 of file xxhash.hh.

Referenced by xxhash_impl().