BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslh::WyHashIncrementalAlgorithm Class Reference

#include <bslh_wyhashincrementalalgorithm.h>

Public Types

enum  { k_SEED_LENGTH = sizeof(uint64_t) }
 
typedef bsls::Types::Uint64 result_type
 Typedef indicating the value type returned by this algorithm.
 

Public Member Functions

 WyHashIncrementalAlgorithm ()
 Create a WyHashIncrementalAlgorithm using a default initial seed.
 
 WyHashIncrementalAlgorithm (uint64_t seed)
 
 WyHashIncrementalAlgorithm (const char *seed)
 
 ~WyHashIncrementalAlgorithm ()=default
 
void operator() (const void *data, size_t numBytes)
 
result_type computeHash ()
 

Detailed Description

This class wraps an implementation of the "WyHash" hash algorithm in an interface that is usable in the modular hashing system in bslh.

See bslh_wyhashincrementalalgorithm

Member Typedef Documentation

◆ result_type

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
k_SEED_LENGTH 

Constructor & Destructor Documentation

◆ WyHashIncrementalAlgorithm() [1/3]

bslh::WyHashIncrementalAlgorithm::WyHashIncrementalAlgorithm ( )
inline

◆ WyHashIncrementalAlgorithm() [2/3]

bslh::WyHashIncrementalAlgorithm::WyHashIncrementalAlgorithm ( uint64_t  seed)
inlineexplicit

Create a bslh::WyHashIncrementalAlgorithm, seeded with the specified seed.

◆ WyHashIncrementalAlgorithm() [3/3]

bslh::WyHashIncrementalAlgorithm::WyHashIncrementalAlgorithm ( const char *  seed)
inlineexplicit

Create a bslh::WyHashIncrementalAlgorithm, seeded with k_SEED_LENGTH bytes of data starting at the specified seed.

◆ ~WyHashIncrementalAlgorithm()

bslh::WyHashIncrementalAlgorithm::~WyHashIncrementalAlgorithm ( )
default

Member Function Documentation

◆ computeHash()

WyHashIncrementalAlgorithm::result_type bslh::WyHashIncrementalAlgorithm::computeHash ( )
inline

Return the finalized version of the hash that has been accumulated. Note that this changes the internal state of the object, so calling computeHash() multiple times in a row will return different results, and only the first result returned will match the expected result of the algorithm. Also note that a value will be returned, even if data has not been passed into operator()

◆ operator()()

void bslh::WyHashIncrementalAlgorithm::operator() ( const void *  data,
size_t  numBytes 
)
inline

Incorporate the specified data, of at least the specified numBytes, into the internal state of the hashing algorithm. Every bit of data incorporated into the internal state of the algorithm will contribute to the final hash produced by computeHash(). The same hash value will be produced regardless of whether a sequence of bytes is passed in all at once or through multiple calls to this member function. Input where numBytes is 0 will have no effect on the internal state of the algorithm. The behaviour is undefined unless data points to a valid memory location with at least numBytes bytes of initialized memory or numBytes is zero.


The documentation for this class was generated from the following file: