15 #include "hashGenerator.h"
16 #include "primeNumberGenerator.h"
27 static const int max_prime_numbers = 10000;
47 nassertv(_index >= 0 && _index < max_prime_numbers);
48 _hash += _primes[_index] * num;
49 _index = (_index + 1) % max_prime_numbers;
61 string::const_iterator si;
62 for (si = str.begin(); si != str.end(); ++si) {
74 return (
unsigned long)(_hash & 0xffffffff);
void add_string(const string &str)
Adds a string to the hash, by breaking it down into a sequence of integers.
void add_int(int num)
Adds another integer to the hash so far.
unsigned long get_hash() const
Returns the hash number generated.