feisty meow concerns codebase
2.140
|
A hashing algorithm takes a key and derives a related integer from it. More...
#include <hash_table.h>
Public Member Functions | |
virtual basis::un_int | hash (const void *key_data, int key_length) const =0 |
returns a hash value based on the "key_data" and "key_length". More... | |
virtual hashing_algorithm * | clone () const =0 |
supports virtual construction of new algorithm objects. More... | |
A hashing algorithm takes a key and derives a related integer from it.
The hashing_algorithm is used in hash_tables for placing objects into slots that can be easily found again. The numerical hash should be faster than actually doing a search on what might be unsorted data otherwise.
Definition at line 40 of file hash_table.h.
|
pure virtual |
supports virtual construction of new algorithm objects.
Implements basis::clonable.
Implemented in structures::astring_hasher, structures::string_hasher, and structures::rotating_byte_hasher.
|
pure virtual |
returns a hash value based on the "key_data" and "key_length".
the "key_length" is provided from the sizeof() of the key type used in the hash_table (below). it is up to the implementor to create a hash value that spreads the keys to be hashed appropriately. if similar keys create same or similar hash values, then the efficiency of the hash_table is compromised.
Implemented in structures::astring_hasher, structures::string_hasher, and structures::rotating_byte_hasher.