--- /root/amitSIPPChange/sippOLD/sipp/trunk/call.cppORIG	2006-11-21 04:15:59.000000000 -0500
+++ ./call.cpp	2006-11-22 05:33:25.000000000 -0500
@@ -540,27 +540,13 @@
 /******* Very simple hash for retransmission detection  *******/
 
 unsigned long hash(char * msg) {
-  unsigned long rv = 0;
-  int len = strlen(msg);
-  int index = 0;
+	unsigned long hash = 0;
+        int c;
   
-  if (len > 4) {
-    rv  = msg[0] + msg[1] + msg[2] + msg[3];
-  }
-  
-  if (len > 12) {
-    rv += msg[9] + msg[10] + msg[11] + msg[12];
-  }
-
-  rv <<= 8;
-  rv += len;
-  rv <<= 16;
-  
-  for (index = 0; index < len; index ++) {
-    rv += + msg[index] * index;
-  }
+        while (c = *msg++)
+            hash = c + (hash << 6) + (hash << 16) - hash;
   
-  return rv;
+        return hash;
 }
 
 /******************* Call class implementation ****************/
