feisty meow concerns codebase 2.140
byte_hasher.h
Go to the documentation of this file.
1#ifndef ROTATING_BYTE_HASHER_CLASS
2#define ROTATING_BYTE_HASHER_CLASS
3
4/*****************************************************************************\
5* *
6* Name : rotating_byte_hasher *
7* Author : Chris Koeritz *
8* *
9*******************************************************************************
10* Copyright (c) 2001-$now By Author. This program is free software; you can *
11* redistribute it and/or modify it under the terms of the GNU General Public *
12* License as published by the Free Software Foundation; either version 2 of *
13* the License or (at your option) any later version. This is online at: *
14* http://www.fsf.org/copyleft/gpl.html *
15* Please send any updates to: fred@gruntose.com *
16\*****************************************************************************/
17
18#include "byte_hasher.h"
19#include "checksums.h"
20#include "hash_table.h"
21
22#include <basis/definitions.h>
23
24namespace structures {
25
27
36{
37public:
39
40 virtual basis::un_int hash(const void *key_data, int key_length) const
41 { return checksums::hash_bytes(key_data, key_length); }
43
48 virtual hashing_algorithm *clone() const
49 { return new rotating_byte_hasher; }
51};
52
53} //namespace.
54
55#endif
56
static basis::un_int hash_bytes(const void *key_data, int key_length)
returns a value that can be used for indexing into a hash table.
Definition checksums.cpp:74
A hashing algorithm takes a key and derives a related integer from it.
Definition hash_table.h:46
Implements a hashing algorithm based on the contents stored in an object.
Definition byte_hasher.h:36
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.
Definition byte_hasher.h:40
virtual hashing_algorithm * clone() const
implements cloning of the algorithm object.
Definition byte_hasher.h:47
Constants and objects used throughout HOOPLE.
unsigned int un_int
Abbreviated name for unsigned integers.
Definition definitions.h:62
A dynamic container class that holds any kind of object via pointers.
Definition amorph.h:55