feisty meow concerns codebase  2.140
structures::rotating_byte_hasher Class Reference

Implements a hashing algorithm based on the contents stored in an object. More...

#include <byte_hasher.h>

Inheritance diagram for structures::rotating_byte_hasher:
Collaboration diagram for structures::rotating_byte_hasher:

Public Member Functions

virtual ~rotating_byte_hasher ()
 
virtual basis::un_int hash (const void *key_data, int key_length) const
 returns a value that can be used for indexing into a hash table. More...
 
virtual hashing_algorithmclone () const
 implements cloning of the algorithm object. More...
 

Detailed Description

Implements a hashing algorithm based on the contents stored in an object.

This will only be usable for key types that have flat members; keys with pointers limit the meaning of the hash value, or destroy the meaning if the pointer value can change between lookups. Note that objects based on RTTI will probably never work with this either since the compiler stores extra data as part of the binary form for those objects.

Definition at line 35 of file byte_hasher.h.

Constructor & Destructor Documentation

◆ ~rotating_byte_hasher()

virtual structures::rotating_byte_hasher::~rotating_byte_hasher ( )
inlinevirtual

Definition at line 38 of file byte_hasher.h.

Member Function Documentation

◆ clone()

virtual hashing_algorithm* structures::rotating_byte_hasher::clone ( ) const
inlinevirtual

implements cloning of the algorithm object.

Implements structures::hashing_algorithm.

Definition at line 47 of file byte_hasher.h.

◆ hash()

virtual basis::un_int structures::rotating_byte_hasher::hash ( const void *  key_data,
int  key_length 
) const
inlinevirtual

returns a value that can be used for indexing into a hash table.

the returned value is loosely based on the "key_data" and the "key_length" we are provided with. note: do not use a huge key length for this or your hash table will be very slow; the key should probably be limited to 16 or less.

Implements structures::hashing_algorithm.

Definition at line 40 of file byte_hasher.h.

References structures::checksums::hash_bytes().


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