From 2fde357ea3cbea001dcf2f8236e24d00b2470d0a Mon Sep 17 00:00:00 2001 From: Matt Alexander Date: Sat, 4 Dec 2021 07:46:12 -0600 Subject: [PATCH] fix issue #8: Support for Md5sum files --- filehash/filehash.py | 1 + testdata/hashes.md5 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/filehash/filehash.py b/filehash/filehash.py index d8becac..cddfbd5 100644 --- a/filehash/filehash.py +++ b/filehash/filehash.py @@ -264,6 +264,7 @@ def verify_checksums(self, checksum_filename): with open(checksum_filename, mode="r") as checksum_list: for line in checksum_list: expected_hash, filename = line.strip().split(" ", 1) + filename = filename.strip() if filename.startswith("*"): filename = filename[1:] actual_hash = self.hash_file(filename) diff --git a/testdata/hashes.md5 b/testdata/hashes.md5 index c46f096..5ef0957 100644 --- a/testdata/hashes.md5 +++ b/testdata/hashes.md5 @@ -1,2 +1,2 @@ -72f5d9e3a5fa2f2e591487ae02489388 *lorem_ipsum.txt -860f55178330e675fb0d55ac1f2c27b2 *lorem_ipsum.zip +72f5d9e3a5fa2f2e591487ae02489388 lorem_ipsum.txt +860f55178330e675fb0d55ac1f2c27b2 lorem_ipsum.zip