We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2407142 commit f8dafc9Copy full SHA for f8dafc9
dataintegrityfingerprint/dif.py
@@ -104,7 +104,7 @@ def file_hash_list(self):
104
@property
105
def checksums(self):
106
rtn = ""
107
- for h, fl in self.file_hash_list:
+ for h, fl in sorted(self.file_hash_list, key=lambda x: x[1]):
108
rtn += u"{0}{1}{2}\n".format(h, self.CHECKSUM_FILENAME_SEPARATOR,
109
fl)
110
return rtn
@@ -116,7 +116,8 @@ def dif(self):
116
117
hasher = new_hash_instance(self._hash_algorithm,
118
self.allow_non_cryptographic_algorithms)
119
- hasher.update(self.checksums.encode("utf-8"))
+ concat = "".join(["".join(x) for x in self.file_hash_list])
120
+ hasher.update(concat.encode("utf-8"))
121
return hasher.checksum
122
123
def count_files(self):
0 commit comments