Message45680
Logged In: YES
user_id=973611
Uploading a new patch (base256.diff). This implements only
the string-> long (or int) conversion. It adds support for
radix 256 (unsigned) or -256 (2's-complement signed) to the
int() and long() built-ins:
int("\xFF\xFF\xFF", 256) -> 0xFFFFFF
int("\xFF\xFF\xFF", -256) -> -1
long(os.urandom(128), 256) -> 1024-bit integer
I left out the long -> string conversion. If python adds a
bytes() type, then that conversion could be done as
bytes(long). This patch has docs and tests. |
|
Date |
User |
Action |
Args |
2007-08-23 15:36:55 | admin | link | issue923643 messages |
2007-08-23 15:36:55 | admin | create | |
|