Use hashlib instead of md5 library

md5 library is deprecated since version 2.5.