26 static const int max_prime_numbers = 10000;
42 nassertv(_index >= 0 && _index < max_prime_numbers);
43 _hash += _primes[_index] * num;
44 _index = (_index + 1) % max_prime_numbers;
53 std::string::const_iterator si;
54 for (si = str.begin(); si != str.end(); ++si) {
65 vector_uchar::const_iterator bi;
66 for (bi = bytes.begin(); bi != bytes.end(); ++bi) {
76 return (
unsigned long)(_hash & 0xffffffff);
void add_int(int num)
Adds another integer to the hash so far.
void add_string(const std::string &str)
Adds a string to the hash, by breaking it down into a sequence of integers.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_blob(const vector_uchar &bytes)
Adds a blob to the hash, by breaking it down into a sequence of integers.
unsigned long get_hash() const
Returns the hash number generated.