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)

 

posted @ 2020-10-29 15:07  我忘不掉  阅读(2888)  评论(0编辑  收藏  举报