From 01ca214217f7feacd1f27c75f101fac771daf611 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 15 Mar 2011 09:30:22 +0100 Subject: [PATCH] s3: Use jenkins hash for str_checksum, fix bug 8010 From the bugreport: I have a folder with ~90 photos: IMG_XXXX.JPG where XXXX is a four digit number, almost consecutive (photos from camera for one day). Current implementation gives about 30 different checksums for this set of files. --- source3/lib/util.c | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-) diff --git a/source3/lib/util.c b/source3/lib/util.c index 81d2a78..b6128fe 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1899,17 +1899,8 @@ const char *tab_depth(int level, int depth) int str_checksum(const char *s) { - int res = 0; - int c; - int i=0; - - while(*s) { - c = *s; - res ^= (c << (i % 15)) ^ (c >> (15-(i%15))); - s++; - i++; - } - return(res); + TDB_DATA key = string_tdb_data(s); + return tdb_jenkins_hash(&key); } /***************************************************************** -- 1.7.0.4