工作方:
#coding=utf-8
from itertools import count
from hashlib import md5
msg = 'randomstring'
for i in count():
hashid = md5(msg+str(i)).hexdigest()
if hashid.startswith('0000'):
print i,hashid
break
输出39496 00001c48020e444f58a297a0785df5cf,即工作方需要md5()39496次.原文地址:http://blog.csdn.net/handsomekang/article/details/39644479