]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Don't use random seed for hash tables it seems meaningless
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Mar 2019 14:24:21 +0000 (14:24 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Mar 2019 14:24:21 +0000 (14:24 +0000)
src/libutil/util.c

index 1f0c5fa705ff48a958808cb740e0e597a352b24a..d5ec578457b4a16f633e0e145ec8d50ac55a6ef4 100644 (file)
@@ -2429,13 +2429,21 @@ rspamd_deinit_libs (struct rspamd_external_libs_ctx *ctx)
 guint64
 rspamd_hash_seed (void)
 {
+#if 0
        static guint64 seed;
 
        if (seed == 0) {
                seed = ottery_rand_uint64 ();
        }
+#endif
 
-       return seed;
+       /* Proved to be random, I promise! */
+       /*
+        * TODO: discover if it worth to use random seed on run
+        * with ordinary hash function or we need to switch to
+        * siphash1-3 or other slow cooker function...
+        */
+       return 0xabf9727ba290690bULL;
 }
 
 static inline gdouble