diff --git a/filehash/filehash.py b/filehash/filehash.py index d8becac..5d6db95 100644 --- a/filehash/filehash.py +++ b/filehash/filehash.py @@ -264,7 +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) - if filename.startswith("*"): + if filename.startswith("*") or filename.startswith(" "): filename = filename[1:] actual_hash = self.hash_file(filename) result.append(VerifyHashResult(filename, expected_hash == actual_hash)) diff --git a/testdata/hashes.md5 b/testdata/hashes.md5 index c46f096..691b467 100644 --- a/testdata/hashes.md5 +++ b/testdata/hashes.md5 @@ -1,2 +1,2 @@ -72f5d9e3a5fa2f2e591487ae02489388 *lorem_ipsum.txt +72f5d9e3a5fa2f2e591487ae02489388 lorem_ipsum.txt 860f55178330e675fb0d55ac1f2c27b2 *lorem_ipsum.zip diff --git a/testdata/hashes.sha1 b/testdata/hashes.sha1 index 4af05f6..fc63df9 100644 --- a/testdata/hashes.sha1 +++ b/testdata/hashes.sha1 @@ -1,2 +1,2 @@ -f7ef3b7afaf1518032da1b832436ef3bbfd4e6f0 *lorem_ipsum.txt +f7ef3b7afaf1518032da1b832436ef3bbfd4e6f0 lorem_ipsum.txt 03da86258449317e8834a54cf8c4d5b41e7c7128 *lorem_ipsum.zip diff --git a/testdata/hashes.sha256 b/testdata/hashes.sha256 index 63dc7a1..587d3c2 100644 --- a/testdata/hashes.sha256 +++ b/testdata/hashes.sha256 @@ -1,2 +1,2 @@ -52ee30e57cc262b84ff73377223818825583b8120394ef54e9b4cd7dbec57d18 *lorem_ipsum.txt +52ee30e57cc262b84ff73377223818825583b8120394ef54e9b4cd7dbec57d18 lorem_ipsum.txt 8acac0dc358b981aef0dcecc6e6d8f4f1fb98968d61e613b430b2389d9d385e5 *lorem_ipsum.zip diff --git a/testdata/hashes.sha512 b/testdata/hashes.sha512 index 4a56f64..44c856b 100644 --- a/testdata/hashes.sha512 +++ b/testdata/hashes.sha512 @@ -1,2 +1,2 @@ -dfc4e13af6e57b4982bdac595e83804dcb2d126204baa290f19015982d13e822a07efa1f0e63a8078e10f219c69d26caf4f21a50e3dd5bdf09bea73dfe224e43 *lorem_ipsum.txt +dfc4e13af6e57b4982bdac595e83804dcb2d126204baa290f19015982d13e822a07efa1f0e63a8078e10f219c69d26caf4f21a50e3dd5bdf09bea73dfe224e43 lorem_ipsum.txt edd841dd0ed5bb09fd21054de3aebbbd44d779beaa0289d63bfb64f0eaaa85c73993d5cbc0d0d1dfcc263d7bd8d43bdafe2bcc398cc8453823e50f0d90a3b0ff *lorem_ipsum.zip