Custom file and directory checksum tool.
- multiple hash algos: c4, md5, sha256, sha512, xxh64
- recursively runs checksums on files in directory trees
- ignores predefined file name patterns
- caches results for better performance
The easiest way to install:
$ pip install -U hashio
Checksum one or more files or directories using one or more hash algorithms (default is xxh64):
$ hashio <PATH> [--algo <ALGO>]
Recursively checksum and gather metadata all the files in a dir tree, and output results to a JSON file:
$ hashio <DIR>
Note that files matching patterns defined in config.IGNORABLE
will be skipped.
Verify paths in previously generated JSON file by comparing stored mtimes (if available) or regenerated hash values if mtimes are missing or different:
$ hashio --verify hash.json
You modifiy settings in the environment stack file hashio.env
, or create a new
environment stack:
$ cp hashio.env debug.env
$ vi debug.env # make edits
$ ./debug.env -- hashio
Generate a hash.json
file for a given path (Default is the current working
directory):
from hashio.worker import HashWorker
worker = HashWorker(path)
worker.run()
Verify pre-generated checksums stored in a hash.json
file:
from hashio.encoder import verify_checksums
for algo, value, miss in verify_checksums("hash.json"):
print("{0} {1}".format(algo, miss))