Tuchuanhuhuhu commited on
Commit
bc488e1
1 Parent(s): 5457fcd

修复哈希值出错的问题

Browse files
Files changed (1) hide show
  1. utils.py +1 -6
utils.py CHANGED
@@ -274,12 +274,7 @@ def submit_key(key):
274
 
275
  def sha1sum(filename):
276
  sha1 = hashlib.sha1()
277
- with open(filename, "rb") as f:
278
- while True:
279
- data = f.read(65536)
280
- if not data:
281
- break
282
- sha1.update(data)
283
  return sha1.hexdigest()
284
 
285
 
 
274
 
275
  def sha1sum(filename):
276
  sha1 = hashlib.sha1()
277
+ sha1.update(filename.encode("utf-8"))
 
 
 
 
 
278
  return sha1.hexdigest()
279
 
280