commit 7f19585: [Minor] Don't use random seed for hash tables it seems meaningless

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Mar 6 14:28:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-03-06 14:24:21 +0000
URL: https://github.com/rspamd/rspamd/commit/7f19585b8e73e31d808ce719b904392a93f63621 (HEAD -> master)

[Minor] Don't use random seed for hash tables it seems meaningless

---
 src/libutil/util.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/libutil/util.c b/src/libutil/util.c
index 1f0c5fa70..d5ec57845 100644
--- a/src/libutil/util.c
+++ b/src/libutil/util.c
@@ -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


More information about the Commits mailing list