MCPcopy Create free account
hub / github.com/XUANXUQAQ/File-Engine / getFileMd5

Function getFileMd5

build.py:106–120  ·  view source on GitHub ↗

计算文件的md5 :param file_name: :return:

(file_name)

Source from the content-addressed store, hash-verified

104
105
106def getFileMd5(file_name):
107 """
108 计算文件的md5
109 :param file_name:
110 :return:
111 """
112 m = hashlib.md5() # 创建md5对象
113 with open(file_name, 'rb') as fobj:
114 while True:
115 data = fobj.read(4096)
116 if not data:
117 break
118 m.update(data) # 更新md5对象
119
120 return m.hexdigest() # 返回md5对象
121
122
123buildDir = 'build'

Callers 1

build.pyFile · 0.85

Calls 1

readMethod · 0.80

Tested by

no test coverage detected