源码链接 个人博客地址 具体实现 import hashlib path = '' with open(path, 'rb') as f: print(hashlib.md5(f.read()).hexdigest())