I have an integer that I want to encode as a hex string, but I don't
want "0x" at the beginning, nor do I want "L" at the end if it happened
to be a long. The result needs to be something I can pass to int(h, 16)
to get back my original integer.
The brute force way works:
h = hex(i)
ass
On 12/24/12 09:36, Roy Smith wrote:
> I have an integer that I want to encode as a hex string, but I don't
> want "0x" at the beginning, nor do I want "L" at the end if it happened
> to be a long. The result needs to be something I can pass to int(h, 16)
> to get back my original integer.
>
>
In article ,
Tim Chase wrote:
> On 12/24/12 09:36, Roy Smith wrote:
> > I have an integer that I want to encode as a hex string, but I don't
> > want "0x" at the beginning, nor do I want "L" at the end if it happened
> > to be a long. The result needs to be something I can pass to int(h, 16)
On 2012-12-24 15:58, Tim Chase wrote:
On 12/24/12 09:36, Roy Smith wrote:
I have an integer that I want to encode as a hex string, but I don't
want "0x" at the beginning, nor do I want "L" at the end if it happened
to be a long. The result needs to be something I can pass to int(h, 16)
to get b