python - Python blocksize 大小混乱
问题描述
我是 python 编程的新手,因此我在本节中感到困惑。当我在代码中分配块大小时,例如blocksize=512,它是以字节为单位的吗?
BLOCKSIZE = 65536
start_time = process_time()
hasher = hashlib.sha512()
with open(file_dir+file_name, 'rb') as hashfile:
buf = hashfile.read(BLOCKSIZE)
while len(buf) > 0:
hasher.update(buf)
buf = hashfile.read(BLOCKSIZE)
hashfile.close()
解决方案
推荐阅读
- angular - 如何延迟加载一个非常大的库(Reveal BI)
- reactjs - Axios 和循环承诺
- c - 在 Debian CMake 中找不到“libmosquitto”
- java - 简单 Java 程序中的字符串输入被忽略
- javascript - 如果 PDFMake 中的值为空,则隐藏表格内容
- r - “平均绝对误差时间序列数据矩阵”
- apache-spark - 拆分 Spark 平面图
- sql - SQL Server 2019 存储过程中的 XML 节点需要 where 子句
- r - 如何在 rgl (R) 中绘制带有图例的 3D
- javascript - 为映射列表中的每个项目呈现承诺值