Commit ed769dd6 authored by Alain Takoudjou's avatar Alain Takoudjou

librecipe/filehash: remove duplicated import on hashlib

parent 9dac0938
...@@ -52,15 +52,13 @@ def filehash(filename, type_=DEFAULT_HASH): ...@@ -52,15 +52,13 @@ def filehash(filename, type_=DEFAULT_HASH):
return return
def generateHashFromFiles(file_list): def generateHashFromFiles(file_list):
import hashlib
hasher = hashlib.md5() hasher = hashlib.md5()
for path in file_list: for path in file_list:
with open(path, 'rb') as afile: with open(path, 'rb') as afile:
buf = buf =
hasher.update(b"%u\n" % len(buf)) hasher.update(b"%u\n" % len(buf))
hasher.update(buf) hasher.update(buf)
hash = hasher.hexdigest() return hasher.hexdigest()
return hash
# Home made hashdeep <> # Home made hashdeep <>
def dirhash(dirname, type_=DEFAULT_HASH): def dirhash(dirname, type_=DEFAULT_HASH):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment