Skip to content

Commit

Permalink
Ensure stable file order during mechanism hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
frthjf committed Jan 26, 2024
1 parent c0174bb commit d1601fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/miv_simulator/mechanisms.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def compile(
mod_files = glob(os.path.join(src, "**/*.mod"), recursive=True)
else:
mod_files = glob(os.path.join(src, "*.mod"))
for m in mod_files:
for m in sorted(mod_files, key=lambda x: x.replace(src, "")):
with open(m, "r") as fm:
data = fm.read()
hash_object.update(data.encode())
Expand Down

0 comments on commit d1601fe

Please sign in to comment.