j0h

hg2f id the runtime

j0h
Sep 30th, 2026
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. python3 - <<'PY'
  2. from pathlib import Path
  3. import hashlib
  4.  
  5. os_root = Path("os_update")
  6. znv_root = Path("../Read_regs_znv/files")
  7.  
  8. def hashes(root):
  9. out = {}
  10. for p in root.rglob("*"):
  11. if not p.is_file():
  12. continue
  13. try:
  14. h = hashlib.sha256(p.read_bytes()).hexdigest()
  15. except OSError:
  16. continue
  17. out.setdefault(h, []).append(p)
  18. return out
  19.  
  20. a = hashes(os_root)
  21. b = hashes(znv_root)
  22.  
  23. for h in sorted(a.keys() & b.keys()):
  24. print(h)
  25. for p in a[h]:
  26. print(" OS: ", p)
  27. for p in b[h]:
  28. print(" ZNV:", p)
  29. print()
  30. PY
  31. kn@ker:~/fc6a/HMI/dev/test/Read_regs$
  32. 53fefb4d107b7c4ac8895a8cd50f892cd96aafef08d31206d1e80c3cc1da0b57
  33. OS: os_update/home/root/idec_operation.BIN
  34. ZNV: ../Read_regs_znv/files/HG2F.BIN
  35.  
Advertisement
Add Comment
Please, Sign In to add comment