for doing a circular shift.
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6709
91ce42f0-d328-0410-95d8-
f526ca767f89
{
hash = 0;
for (char *p=key; *p; p++) {
- hash += (hash << 3) + (uint32_t)*p;
+// hash += (hash << 3) + (uint32_t)*p;
+ hash += ((hash << 5) | (hash >> (sizeof(hash)*8-5))) + (uint32_t)*p;
}
/* Multiply by large prime number, take top bits, mask for remainder */
index = ((hash * 1103515249) >> rshift) & mask;
General:
31Mar08
+kes Tweak hash algorithm for htable using Martin Simmons idea
+ for doing a circular shift.
kes Remember what volume is in VTLs (previously turned off for
testing).
kes Analysis of JobMedia records by Tom Ivar Helbekkmo <tih@hamartun.priv.no>