Skip to main content

Simple utility to hash the contents of files and store hashes in a cache for quick repeat hashing

Project description

Caching File Hasher

Simple utility to hash the contents of files and store hashes in a cache for quick repeat hashing.

Installing

pip install hashkeep

Basic Usage

from pathlib import Path
from hashlib import md5

from hashkeep import CachingFileHasher

hasher = CachingFileHasher(hasher=m5d, cache_path=Path('.cache'))
hasher.get_file_hash('file.dat') == '9dd4e461268c8034f5c8564e155c67a6'

Command Line Usage

usage: hashkeep [-h]
                [--hasher {blake2b,blake2s,md5,md5-sha1,ripemd160,sha1,sha224,sha256,sha384,sha3_224,sha3_256,
                           sha3_384,sha3_512,sha512,sha512_224,sha512_256,shake_128,shake_256,sm3}]
                [--hash-only] [--cache-path CACHE_PATH]
                [--cache-for CACHE_FOR]
                paths [paths ...]

Perform file hash and cache results

positional arguments:
  paths                 File to hash

options:
  -h, --help            show this help message and exit
  --hasher {blake2b,blake2s,md5,md5-sha1,ripemd160,sha1,sha224,sha256,sha384,sha3_224,sha3_256,
            sha3_384,sha3_512,sha512,sha512_224,sha512_256,shake_128,shake_256,sm3}
                        Which hashing algorithm to use
  --hash-only           Only print file hash
  --cache-path CACHE_PATH
                        Where to cache computed file hashes
  --cache-for CACHE_FOR
                        Seconds to cache hashes for (default 365 days)

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

hashkeep-1.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hashkeep-1.0.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file hashkeep-1.0.1.tar.gz.

File metadata

  • Download URL: hashkeep-1.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for hashkeep-1.0.1.tar.gz
Algorithm Hash digest
SHA256 bd5f823c1a149b1f48bd60fc99acd5e4eec11ce349041451c6086ad988ee7612
MD5 2afa14668cd5c09118dc51e249e0c65d
BLAKE2b-256 b8254b1a2b6d4c3554c3cf4069cdb8965cb1b954a93240e8599176cd6d5b057f

See more details on using hashes here.

File details

Details for the file hashkeep-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: hashkeep-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for hashkeep-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03ea2e9474e29c19132afdba02e66dd5b634345188ee02391c541ab8e950a4c2
MD5 045393cea388f165fca1163955a18ebf
BLAKE2b-256 bef14a1801ed33033d6dbae6bf4491b34bd76e7fbbb002d2d5635848c6e88466

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