<< January 2009 | Home | March 2009 >>

MD5 Hash in Python 3000

I normally use Python to quickly calculate MD5 hashes, so you can imagine my surprise when after typing 'import md5' Python returned 'ImportError: No module named md5'.  It turns out that Python 3000 has decommissioned the md5 library in favor of hashlib, and it had been deprecated in Python 2.6...

>>> from hashlib import md5
>>> md5(bytes("password", "utf-8")).hexdigest()
'5f4dcc3b5aa765d61d8327deb882cf99'
Tags : ,
Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Export this post as PDF document  Export this post to PDF document