python 获取图片的md5值

filepath = 'C://Users/Admin/Downloads/Snipaste_2020-10-29_14-22-44.png'
    file = open(filepath, "rb")
    md = hashlib.md5()
    md.update(file.read())
    res1 = md.hexdigest()
    print(res1)
原文地址:https://www.cnblogs.com/chenlizhi/p/13896825.html