[issue6598] calling email.utils.make_msgid frequently has a non-trivial probability of generating colliding ids

Serhiy Storchaka report at bugs.python.org
Sun May 17 19:46:32 CEST 2015


Serhiy Storchaka added the comment:

Currently the maximal length of local part is

    14+1+len(str(2**16))+1+len(str(10**5-1)) == 26

With the patch it will be

    len(str(2**31*100))+1+len(str(2**16))+1+len(str(2**64)) = 39

If encode all three numbers with hexadecimal, it will be

    len('%x'%(2**31*100))+1+len('%x'%(2**16))+1+len('%x'%(2**64)) = 34

If encode their with base32:

    math.ceil((31+math.log(100)/math.log(2))/5)+1+math.ceil(16/5)+1+math.ceil(64/5) = 27

Using base64 or base85 can be not safe, because message ID can be used as file name in case-insensitive file system.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6598>
_______________________________________


More information about the Python-bugs-list mailing list