Skip to content

Instantly share code, notes, and snippets.

View bruienne's full-sized avatar

Pepijn Bruienne bruienne

View GitHub Profile
@pudquick
pudquick / measure.py
Last active February 8, 2023 16:05
Get a sorted descriptive json output of hashes for a directory, suitable for diffing
#!/usr/bin/env python3
import os, os.path, json, hashlib, subprocess, argparse, sys, stat
BUFFER_SIZE = 65536
def checksum_directory(source_path, progress=False):
filesystem_details = dict()
# rough guess of how many files are in a directory
# horrible hack with a little fudge
if not os.path.isdir(source_path):