source3/lib/util.c: str_checksum to use Jenkins hash from CCAN.
[ira/wip.git] / source3 / lib / util.c
index d04887c854ceb231fe7b0037a3f1fd0c5a2272c5..b25c15c7a3e894f1796d24c8f46927b35cdcfe49 100644 (file)
@@ -28,6 +28,7 @@
 #include "ctdbd_conn.h"
 #include "../lib/util/util_pw.h"
 #include "messages.h"
+#include <ccan/hash/hash.h>
 
 /* Max allowable allococation - 256mb - 0x10000000 */
 #define MAX_ALLOC_SIZE (1024*1024*256)
@@ -1306,8 +1307,9 @@ const char *tab_depth(int level, int depth)
 
 int str_checksum(const char *s)
 {
-       TDB_DATA key = string_tdb_data(s);
-       return tdb_jenkins_hash(&key);
+       if (s == NULL)
+               return 0;
+       return hash(s, strlen(s), 0);
 }
 
 /*****************************************************************