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)

This commit is contained in:
Miroslav Stampar 2014-05-29 09:21:48 +02:00
parent 680ab10ca6
commit 9e02816cbd

View File

@ -63,7 +63,7 @@ class HashDB(object):
@staticmethod @staticmethod
def hashKey(key): def hashKey(key):
key = key.encode(UNICODE_ENCODING) if isinstance(key, unicode) else repr(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 return retVal
def retrieve(self, key, unserialize=False): def retrieve(self, key, unserialize=False):