openMSX
Classes | Functions | Variables
xxhash.hh File Reference
#include "likely.hh"
#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<int R>
constexpr uint32_t rotl (uint32_t x)
 
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 64 of file xxhash.hh.

◆ rotl()

template<int R>
constexpr uint32_t rotl ( uint32_t  x)
constexpr

Definition at line 58 of file xxhash.hh.

References openmsx::R, and openmsx::x.

◆ xxhash()

uint32_t xxhash ( std::string_view  key)
inline

Definition at line 144 of file xxhash.hh.

Referenced by XXHasher::operator()(), and openmsx::XXTclHasher::operator()().

◆ xxhash_case()

uint32_t xxhash_case ( std::string_view  key)
inline

Definition at line 148 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 80 of file xxhash.hh.

References PRIME32_1, PRIME32_2, PRIME32_3, PRIME32_4, PRIME32_5, utf8::unchecked::size(), unlikely, and v4.

◆ xxhash_impl() [2/2]

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

Definition at line 132 of file xxhash.hh.

References utf8::unchecked::size().

Variable Documentation

◆ PRIME32_1

constexpr uint32_t PRIME32_1 = 2654435761
constexpr

Definition at line 50 of file xxhash.hh.

Referenced by xxhash_impl().

◆ PRIME32_2

constexpr uint32_t PRIME32_2 = 2246822519
constexpr

Definition at line 51 of file xxhash.hh.

Referenced by xxhash_impl().

◆ PRIME32_3

constexpr uint32_t PRIME32_3 = 3266489917
constexpr

Definition at line 52 of file xxhash.hh.

Referenced by xxhash_impl().

◆ PRIME32_4

constexpr uint32_t PRIME32_4 = 668265263
constexpr

Definition at line 53 of file xxhash.hh.

Referenced by xxhash_impl().

◆ PRIME32_5

constexpr uint32_t PRIME32_5 = 374761393
constexpr

Definition at line 54 of file xxhash.hh.

Referenced by xxhash_impl().