This class provides a hash algorithm wrapper that improves the distribution of varying bits from the HASH applied to the KEY.

Synopsis

Declared in <bslh_fibonaccibadhashwrapper.h>

template<class HASH>
class FibonacciBadHashWrapper;

Member Functions

Name

Description

FibonacciBadHashWrapper [constructor]

Constructors

operator()

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.

Static Data Members

Name

Description

k_FIBONACCI_HASH_MULTIPLIER

The value corresponds to: ` 2ˆ64 / phi ‐ 1 ` 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.

Created with MrDocs