From 9e02816cbd4ea7ed4a67706f2a317d2d79d15fbe Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 29 May 2014 09:21:48 +0200 Subject: [PATCH] Raising number of used md5 digits in hashdb key value because of birthday paradox (Python can handle it - automatically expanding to long if required; SQLite can handle it - it will use 6 bytes per INTEGERs instead of 4) --- lib/utils/hashdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/hashdb.py b/lib/utils/hashdb.py index f0aa783f2..9c42cf884 100644 --- a/lib/utils/hashdb.py +++ b/lib/utils/hashdb.py @@ -63,7 +63,7 @@ class HashDB(object): @staticmethod def hashKey(key): key = key.encode(UNICODE_ENCODING) if isinstance(key, unicode) else repr(key) - retVal = int(hashlib.md5(key).hexdigest()[:8], 16) + retVal = int(hashlib.md5(key).hexdigest()[:12], 16) return retVal def retrieve(self, key, unserialize=False):