Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- python3 - <<'PY'
- from pathlib import Path
- import hashlib
- os_root = Path("os_update")
- znv_root = Path("../Read_regs_znv/files")
- def hashes(root):
- out = {}
- for p in root.rglob("*"):
- if not p.is_file():
- continue
- try:
- h = hashlib.sha256(p.read_bytes()).hexdigest()
- except OSError:
- continue
- out.setdefault(h, []).append(p)
- return out
- a = hashes(os_root)
- b = hashes(znv_root)
- for h in sorted(a.keys() & b.keys()):
- print(h)
- for p in a[h]:
- print(" OS: ", p)
- for p in b[h]:
- print(" ZNV:", p)
- print()
- PY
- kn@ker:~/fc6a/HMI/dev/test/Read_regs$
- 53fefb4d107b7c4ac8895a8cd50f892cd96aafef08d31206d1e80c3cc1da0b57
- OS: os_update/home/root/idec_operation.BIN
- ZNV: ../Read_regs_znv/files/HG2F.BIN
Advertisement
Add Comment
Please, Sign In to add comment