Converting strings to hex
jgraves3 at austin.rr.com
Fri May 19 03:47:56 CEST 2000
On Fri, 19 May 2000 00:28:46 GMT, kzaragoza at mediaone.net (Kris J.
>That's funny, I was _just_ playing with this very functionality!
> import string
> ret = 
> for c in md5string:
> ret.append("%02X" % ord(c))
> return string.join(ret,"")
It must be something in the air. I also needed this yesterday and a
DejaNews search yielded this function from Michael Wallace.
result = ""
for i in binaryString:
result = result + string.zfill(hex(ord(i))[2:],2)
More information about the Python-list