美文网首页
Python3校验MD5值

Python3校验MD5值

作者: rocfly007 | 来源:发表于2018-12-11 15:37 被阅读0次

    '''

import hashlib

import os

def GetFileMd5(filename):

    if not os.path.isfile(filename):

        return

    myHash= hashlib.md5()

f= open(filename,'rb')

while True:

        b= f.read(8096)

if not b:

            break

        myHash.update(b)

f.close()

return myHash.hexdigest()

print(GetFileMd5('/Users/binyun007/Desktop/293_4060F.apk'))

'''

相关文章

网友评论

      本文标题:Python3校验MD5值

      本文链接:https://www.haomeiwen.com/subject/zdcehqtx.html