|
BDE 4.14.0 Production release
|
#include <bslh_fibonaccibadhashwrapper.h>
Public Member Functions | |
| FibonacciBadHashWrapper () | |
| FibonacciBadHashWrapper (const HASH &hash) | |
Create a FibonacciBadHashWrapper having the specified hash. | |
| FibonacciBadHashWrapper (const FibonacciBadHashWrapper &original)=default | |
| ~FibonacciBadHashWrapper ()=default | |
| FibonacciBadHashWrapper & | operator= (const FibonacciBadHashWrapper &rhs)=default |
| template<class KEY > | |
| size_t | operator() (const KEY &key) const |
Static Public Attributes | |
| static const bsls::Types::Uint64 | k_FIBONACCI_HASH_MULTIPLIER = 11400714819323198485ull |
This class provides a hash algorithm wrapper that improves the distribution of varying bits from the HASH applied to the KEY.
|
inline |
Create a FibonacciBadHashWrapper having a default constructed hash.
|
inlineexplicit |
|
default |
|
default |
|
inline |
Return the hash of the specified key, computed as the product of the result of the hash function supplied at construction and k_FIBONACCI_HASH_MULTIPLIER.
|
default |
|
static |
The value corresponds to:
where phi is the Golden Ratio and 1 is subtracted to avoid the value being a multiple of 2 (that would throw away one bit of information from the resultant hash value). See https://en.wikipedia.org/wiki/Hash_function#Fibonacci_hashing.