[New-bugs-announce] [issue27925] Nicer interface to convert hashlib digests to int

Steven D'Aprano report at bugs.python.org
Thu Sep 1 04:31:48 EDT 2016


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 <report at bugs.python.org>
<http://bugs.python.org/issue27925>
_______________________________________


More information about the New-bugs-announce mailing list