converting data to hex

Peter Abel p-abel at t-online.de
Sat Feb 1 20:05:32 CET 2003


Erik Max Francis <max at alcyone.com> wrote in message news:<3E3A4329.CF453983 at alcyone.com>...
> Peter Abel wrote:
> 
> > >>> md5_string='788acf0f5ce8813cbdbddf510b54fb6f'
> > >>> eval('0x'+md5_string)
> > 160228096136631806570404481192208694127L
> 
> Scary.  Try long(md5_string, 16) instead.

About 3 times faster.

Peter




More information about the Python-list mailing list