converting data to hex

Mark Harrison mh at pixar.com
Thu Jan 30 19:00:48 EST 2003


warning: newbie alert!

I've got an md5 digest and would like to print it as
a hex value, but I can't get the individual hex value
formatted.  Can someone loan me a clue?

import md5
d = md5.new("foo")
for x in d.digest():
    print "a", ("%02x" % x)  ## how do I convert x to int???

Many TIA!
Mark

-- 
Mark Harrison
Pixar Animation Studios




More information about the Python-list mailing list