Hashing a file in Python

前端 未结 6 1144
误落风尘
误落风尘 2020-11-27 10:55

I want python to read to the EOF so I can get an appropriate hash, whether it is sha1 or md5. Please help. Here is what I have so far:

import hashlib

inputF         


        
6条回答
  •  独厮守ぢ
    2020-11-27 11:30

    I have programmed a module wich is able to hash big files with different algorithms.

    pip3 install py_essentials
    

    Use the module like this:

    from py_essentials import hashing as hs
    hash = hs.fileChecksum("path/to/the/file.txt", "sha256")
    

提交回复
热议问题