Serhiy Storchaka added the comment:

There is another way:

    int.from_bytes(x.digest(), 'big')

Note that converting to int you lose the length of the digest. md5 digest 
d41d8cd98f00b204e9800998ecf8427e and sha1 digest 
00000000d41d8cd98f00b204e9800998ecf8427e are converted to the same int. This 
can add a vulnerability.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27925>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to