Python块大小混淆

时间:2019-02-11 21:18:27

标签: python

我是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()

0 个答案:

没有答案