Skip to main content

Custom file and directory checksum tool

Project description

hashio

Custom file and directory checksum tool.

Features

  • 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

Installation

The easiest way to install:

$ pip install -U hashio

Usage

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

Environments

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

Python API

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))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hashio-0.2.1.tar.gz (16.6 kB view details)

Uploaded Source

File details

Details for the file hashio-0.2.1.tar.gz.

File metadata

  • Download URL: hashio-0.2.1.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.10

File hashes

Hashes for hashio-0.2.1.tar.gz
Algorithm Hash digest
SHA256 097baca331f7c226cce28cfedb283330db3f7278d37e2dc3eb2b093fed99d03d
MD5 5b9f3b2409ea8ae7ab076e749dd1e04d
BLAKE2b-256 00a84daa023c450ecc119d4223ba37bfb122b67e12813de182b15765864ee68d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page