Get MD5 value of a file

Get MD5 value of a file

method 1:  process under console

certutil -hashfile  1.jpg  MD5

 

method 2:  process under python 

import  hashlib

def md5(fname):
    hash_md5 = hashlib.md5()
    with open(fname, "rb") as f:
        for chunk in iter(lambda: f.read(4096), b""):
            hash_md5.update(chunk)
    return hash_md5.hexdigest()

猜你喜欢

转载自blog.csdn.net/honk2012/article/details/88825732
今日推荐