rippled
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
beast::xxhasher Class Reference

#include <xxhasher.h>

Collaboration diagram for beast::xxhasher:
Collaboration graph
[legend]

Public Types

using result_type = std::size_t
 

Public Member Functions

 xxhasher (xxhasher const &)=delete
 
xxhasheroperator= (xxhasher const &)=delete
 
 xxhasher ()
 
 ~xxhasher () noexcept
 
template<class Seed , std::enable_if_t< std::is_unsigned< Seed >::value > * = nullptr>
 xxhasher (Seed seed)
 
template<class Seed , std::enable_if_t< std::is_unsigned< Seed >::value > * = nullptr>
 xxhasher (Seed seed, Seed)
 
void operator() (void const *key, std::size_t len) noexcept
 
 operator result_type () noexcept
 

Static Public Attributes

static constexpr auto const endian = boost::endian::order::native
 

Private Member Functions

void resetBuffers ()
 
void updateHash (void const *data, std::size_t len)
 
void flushToState (void const *data, std::size_t len)
 
result_type retrieveHash ()
 

Static Private Member Functions

static XXH3_state_t * allocState ()
 

Private Attributes

std::array< std::uint8_t, INTERNAL_BUFFER_SIZEbuffer_
 
std::span< std::uint8_treadBuffer_
 
std::span< std::uint8_twriteBuffer_
 
std::optional< XXH64_hash_t > seed_
 
XXH3_state_t * state_ = nullptr
 

Static Private Attributes

static constexpr std::size_t INTERNAL_BUFFER_SIZE = 64
 

Detailed Description

Definition at line 35 of file xxhasher.h.

Member Typedef Documentation

◆ result_type

Definition at line 38 of file xxhasher.h.

Constructor & Destructor Documentation

◆ xxhasher() [1/4]

beast::xxhasher::xxhasher ( xxhasher const &  )
delete

◆ xxhasher() [2/4]

beast::xxhasher::xxhasher ( )

Definition at line 137 of file xxhasher.h.

◆ ~xxhasher()

beast::xxhasher::~xxhasher ( )
noexcept

Definition at line 142 of file xxhasher.h.

◆ xxhasher() [3/4]

template<class Seed , std::enable_if_t< std::is_unsigned< Seed >::value > * = nullptr>
beast::xxhasher::xxhasher ( Seed  seed)
explicit

Definition at line 153 of file xxhasher.h.

◆ xxhasher() [4/4]

template<class Seed , std::enable_if_t< std::is_unsigned< Seed >::value > * = nullptr>
beast::xxhasher::xxhasher ( Seed  seed,
Seed   
)

Definition at line 161 of file xxhasher.h.

Member Function Documentation

◆ resetBuffers()

void beast::xxhasher::resetBuffers ( )
private

Definition at line 54 of file xxhasher.h.

◆ updateHash()

void beast::xxhasher::updateHash ( void const *  data,
std::size_t  len 
)
private

Definition at line 61 of file xxhasher.h.

◆ allocState()

static XXH3_state_t * beast::xxhasher::allocState ( )
staticprivate

Definition at line 77 of file xxhasher.h.

◆ flushToState()

void beast::xxhasher::flushToState ( void const *  data,
std::size_t  len 
)
private

Definition at line 86 of file xxhasher.h.

◆ retrieveHash()

result_type beast::xxhasher::retrieveHash ( )
private

Definition at line 109 of file xxhasher.h.

◆ operator=()

xxhasher & beast::xxhasher::operator= ( xxhasher const &  )
delete

◆ operator()()

void beast::xxhasher::operator() ( void const *  key,
std::size_t  len 
)
noexcept

Definition at line 167 of file xxhasher.h.

◆ operator result_type()

beast::xxhasher::operator result_type ( )
explicitnoexcept

Definition at line 173 of file xxhasher.h.

Member Data Documentation

◆ INTERNAL_BUFFER_SIZE

constexpr std::size_t beast::xxhasher::INTERNAL_BUFFER_SIZE = 64
staticconstexprprivate

Definition at line 44 of file xxhasher.h.

◆ buffer_

std::array<std::uint8_t, INTERNAL_BUFFER_SIZE> beast::xxhasher::buffer_
private

Definition at line 46 of file xxhasher.h.

◆ readBuffer_

std::span<std::uint8_t> beast::xxhasher::readBuffer_
private

Definition at line 47 of file xxhasher.h.

◆ writeBuffer_

std::span<std::uint8_t> beast::xxhasher::writeBuffer_
private

Definition at line 48 of file xxhasher.h.

◆ seed_

std::optional<XXH64_hash_t> beast::xxhasher::seed_
private

Definition at line 50 of file xxhasher.h.

◆ state_

XXH3_state_t* beast::xxhasher::state_ = nullptr
private

Definition at line 51 of file xxhasher.h.

◆ endian

constexpr auto const beast::xxhasher::endian = boost::endian::order::native
staticconstexpr

Definition at line 131 of file xxhasher.h.