helloboy91 commited on
Commit
16d9f16
·
verified ·
1 Parent(s): 7c689a2

Support Python 3.10 checksum verification

Browse files
Files changed (1) hide show
  1. tiny_english/artifacts.py +6 -3
tiny_english/artifacts.py CHANGED
@@ -2,6 +2,9 @@ import hashlib
2
  from pathlib import Path
3
 
4
 
5
- def digest_file(path):
6
- with Path(path).open("rb") as handle:
7
- return hashlib.file_digest(handle, "sha256").hexdigest()
 
 
 
 
2
  from pathlib import Path
3
 
4
 
5
+ def digest_file(path):
6
+ digest = hashlib.sha256()
7
+ with Path(path).open("rb") as handle:
8
+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):
9
+ digest.update(chunk)
10
+ return digest.hexdigest()