xrpld
Loading...
Searching...
No Matches
beast::Xxhasher Class Reference

#include <xxhasher.h>

Collaboration diagram for beast::Xxhasher:

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_v< Seed > > * = nullptr>
 Xxhasher (Seed seed)
template<class Seed, std::enable_if_t< std::is_unsigned_v< Seed > > * = 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 kEndian = 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, kInternalBufferSizebuffer_ {}
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 kInternalBufferSize = 64

Detailed Description

Definition at line 18 of file xxhasher.h.

Member Typedef Documentation

◆ result_type

Definition at line 21 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 114 of file xxhasher.h.

◆ ~Xxhasher()

beast::Xxhasher::~Xxhasher ( )
noexcept

Definition at line 119 of file xxhasher.h.

◆ Xxhasher() [3/4]

template<class Seed, std::enable_if_t< std::is_unsigned_v< Seed > > * = nullptr>
beast::Xxhasher::Xxhasher ( Seed seed)
explicit

Definition at line 128 of file xxhasher.h.

◆ Xxhasher() [4/4]

template<class Seed, std::enable_if_t< std::is_unsigned_v< Seed > > * = nullptr>
beast::Xxhasher::Xxhasher ( Seed seed,
Seed  )

Definition at line 134 of file xxhasher.h.

Member Function Documentation

◆ resetBuffers()

void beast::Xxhasher::resetBuffers ( )
private

Definition at line 37 of file xxhasher.h.

◆ updateHash()

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

Definition at line 44 of file xxhasher.h.

◆ allocState()

XXH3_state_t * beast::Xxhasher::allocState ( )
staticprivate

Definition at line 59 of file xxhasher.h.

◆ flushToState()

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

Definition at line 68 of file xxhasher.h.

◆ retrieveHash()

result_type beast::Xxhasher::retrieveHash ( )
private

Definition at line 91 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 140 of file xxhasher.h.

◆ operator result_type()

beast::Xxhasher::operator result_type ( )
explicitnoexcept

Definition at line 146 of file xxhasher.h.

Member Data Documentation

◆ kInternalBufferSize

std::size_t beast::Xxhasher::kInternalBufferSize = 64
staticconstexprprivate

Definition at line 27 of file xxhasher.h.

◆ buffer_

std::array<std::uint8_t, kInternalBufferSize> beast::Xxhasher::buffer_ {}
private

Definition at line 29 of file xxhasher.h.

◆ readBuffer_

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

Definition at line 30 of file xxhasher.h.

◆ writeBuffer_

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

Definition at line 31 of file xxhasher.h.

◆ seed_

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

Definition at line 33 of file xxhasher.h.

◆ state_

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

Definition at line 34 of file xxhasher.h.

◆ kEndian

auto beast::Xxhasher::kEndian = boost::endian::order::native
staticconstexpr

Definition at line 108 of file xxhasher.h.