Ironpython无法计算大尺寸文件的md5check总和

时间:2015-08-20 14:36:47

标签: python ironpython md5sum

import hashlib
with open("file5GB.bin" , 'rb') as fd:
    md5 = hashlib.md5()
    while True:
        data = fd.read(2**20)
        if not data:
            break
        md5.update(data)
    md5_local = md5.hexdigest()
    print md5_local

结果为MemoryError: Exception of type 'System.OutOfMemoryException' was thrown.

相同的代码适用于python。

Ironpython版本:2.7.5,FileSize:5GB

0 个答案:

没有答案