[issue923643] long <-> byte-string conversion
Antoine Pitrou
report at bugs.python.org
Sun Jan 13 23:32:30 CET 2008
Antoine Pitrou added the comment:
Unless I'm mistaken, the patch provides only half of the solution: the
stringToLong part, but not longToString.
I agree this feature is interesting, not for optimization but becomes it
avoids using clunky ways (long -> hex -> bin) to implement something simple.
However, perhaps making it part of either the binascii or the struct
module would allow more formatting choices (e.g. big-endian or
little-endian, fixed-length or not). For example in cryptography you
would want a byte string of a fixed size even if your 512-bit number
happens to have its 8 most significant bits set to zero.
----------
nosy: +pitrou
____________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue923643>
____________________________________
More information about the Python-bugs-list
mailing list