Python的md5 校验

import md5
fname = r”C:\windows\TASKMAN.EXE”
received = md5.md5(file(fname, “rb”).read()).hexdigest()
print received

received 即为16进制的md5校验值。filename是文件的全路径。 

对字符串进行校验

import md5

str = ‘123456789’
received = md5.md5(str).hexdigest()
print received

发表评论

电子邮件地址不会被公开。 必填项已用*标注

机器人检查 *