Spaces:
Paused
Paused
Download genz/checksum.py from zhzabcd/code-server: direct link, hf CLI and curl.
- Browser
- Download file 379 Bytes
-
https://huggingface.co/spaces/zhzabcd/code-server/resolve/main/genz/checksum.py
- Command line
-
hf download hf://spaces/zhzabcd/code-server/genz/checksum.py
-
curl -L -o checksum.py https://huggingface.co/spaces/zhzabcd/code-server/resolve/main/genz/checksum.py
379 Bytes
| import hashlib | |
| def checksum(large_file): | |
| """Calculate MD5 checksum for file.""" | |
| md5_object = hashlib.md5() | |
| block_size = 128 * md5_object.block_size | |
| with open(large_file, 'rb') as a_file: | |
| chunk = a_file.read(block_size) | |
| while chunk: | |
| md5_object.update(chunk) | |
| chunk = a_file.read(block_size) | |
| return md5_object.hexdigest() |