Panda3D
checksumHashGenerator.cxx
1 // Filename: checksumHashGenerator.cxx
2 // Created by: drose (14May01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "checksumHashGenerator.h"
16 
17 ////////////////////////////////////////////////////////////////////
18 // Function: ChecksumHashGenerator::add_string
19 // Access: Public
20 // Description: Adds a string to the hash, by breaking it down into a
21 // sequence of integers.
22 ////////////////////////////////////////////////////////////////////
24 add_string(const string &str) {
25  add_int(str.length());
26  string::const_iterator si;
27  for (si = str.begin(); si != str.end(); ++si) {
28  add_int(*si);
29  }
30 }
void add_string(const string &str)
Adds a string to the hash, by breaking it down into a sequence of integers.
void add_int(long num)
Adds another integer to the hash so far.