faqts : Computers : Programming : Languages : Python : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 11 people (73%) answered Yes
Recently 3 of 5 people (60%) answered Yes

Entry

How can I present output from md5.digest like md5sum from GNU textutils?

Oct 23rd, 2003 04:48
W.J. van der Laan, unknown unknown, Moshe Zadka


try:

for c in digest:
        sys.stdout.write("%02X" % ord(c))

or (slightly faster):

import binascii
print binascii.b2a_hex(digest)