New submission from Steven D'Aprano:

hashlib digests should have a nicer interface to allow conversion to ints.

Currently we write int(x.hexdigest(), 16) which is less than obvious and easy 
to get wrong. It would be nice to be able to just say int(x) (that's my strong 
preference) or x.as_int().

Use-case: sometimes we need to store hashes in a database table which, for 
historical reasons, is an integer.

----------
messages: 274102
nosy: steven.daprano
priority: normal
severity: normal
status: open
title: Nicer interface to convert hashlib digests to int
type: enhancement

_______________________________________
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