pyhton获取文件md5哈希编码
作者:互联网
import hashlib def md5sum(filename, blocksize=65536): hash = hashlib.md5() with open(filename, "rb") as f: for block in iter(lambda: f.read(blocksize), b""): hash.update(block) return hash.hexdigest()
md5可以对每个文件获取近似独一无二的编码
标签:hashlib,hash,blocksize,filename,pyhton,哈希,block,md5 来源: https://www.cnblogs.com/nervendnig/p/12559032.html