feisty meow concerns codebase
2.140
|
Implements a simple hashing algorithm for strings. More...
#include <string_hasher.h>
Public Member Functions | |
virtual basis::un_int | hash (const void *key_data, int key_length) const |
returns a value that can be used to index into a hash table. More... | |
virtual hashing_algorithm * | clone () const |
implements cloning of the algorithm object. More... | |
Implements a simple hashing algorithm for strings.
This uses a portion of the string's contents to create a hash value.
Definition at line 25 of file string_hasher.h.
|
virtual |
implements cloning of the algorithm object.
Implements structures::hashing_algorithm.
Definition at line 30 of file string_hasher.cpp.
|
virtual |
returns a value that can be used to index into a hash table.
the returned value is loosely based on the "key_data" and the "key_length" we are provided with. it is expected that the "key_data" really is a 'char' pointer whose length is "key_length" (including the zero terminator at the end).
Implements structures::hashing_algorithm.
Definition at line 33 of file string_hasher.cpp.
References structures::MAX_STRING_CHARS_USED, and basis::minimum().
Referenced by structures::astring_hasher::hash().