Sha sum files with Python: Revision history

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

8 November 2024

  • curprev 02:4802:48, 8 November 2024413vhcu1lq0463ob talk contribs 418 bytes +418 Created page with " import hashlib def calculate_sha256(file_path): sha256_hash = hashlib.sha256() with open(file_path, "rb") as f: # Read and update hash string value in chunks of 4K for byte_block in iter(lambda: f.read(4096), b""): sha256_hash.update(byte_block) return sha256_hash.hexdigest() # Usage file_path = "path/to/your/file" print("SHA-256:", calculate_sha256(file_path))" Tag: Visual edit