Skip to main content

A command line tool to calculate hashes of directory trees using various hash algorithms.

Project description

hashdir

A command line tool to calculate hash of directory trees using various hash algorithms.

Installing

To install, run the following command in your terminal:

pip3 install hashdir

Installing on Android

You may want to install hashdir through Termux or similar on android to check hashes of directories on your android system.

On some systems, you may have to reinstall python to get development libraries, and install libcrypt before installing hashdir for the installation to work:

apt install python
apt install libcrypt

Otherwise, installation on android is the same as others.

pip3 install hashdir

Usage

usage: hashdir [-h] [-a {md5,sha1,imohash}] [--log-level {error,info,debug}]
               [-v]
               [directory]

A command line tool to calculate hashes of directory trees using various hash
algorithms.

positional arguments:
  directory

optional arguments:
  -h, --help            show this help message and exit
  -a {md5,sha1,imohash}, --algorithm {md5,sha1,imohash}
                        warning: imohash is a constant-time hashing library,
                        and while being fast for large files, it produces
                        approximate results.
  --log-level {error,info,debug}
  -v, --version         show program's version number and exit

Algorithm

Hashdir performs the following steps;

  • Walk the directory tree and find all file paths.
  • Sort file paths to get a consistent hash for every system.
  • Compute the hash value for each file separately using the algorithm selected by the -a option (Or md5 as default).
  • Create a "hash string" using the results. Hash string is a string value which consists of a file path and its hash separated by a space character on each line. Print the hash string.
  • Compute the md5 hash value of the hash string, and print it as the result.

Contributing

Contributions are welcome! Please use black for formatting code before sending a PR.

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

hashdir-0.24.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

hashdir-0.24-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file hashdir-0.24.tar.gz.

File metadata

  • Download URL: hashdir-0.24.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for hashdir-0.24.tar.gz
Algorithm Hash digest
SHA256 82869f8a9003e4282581830afbed96d3160d9ef6fed9c9d81e5d28937ea4d8c3
MD5 376e1d77f4583b6ca5e67aab78b8411c
BLAKE2b-256 319c8e9940a92bcc8d679eeb21db53cbcc22a4c7479f79a6692cf389d2d444f6

See more details on using hashes here.

File details

Details for the file hashdir-0.24-py3-none-any.whl.

File metadata

  • Download URL: hashdir-0.24-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for hashdir-0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 bb807f65240ecd0a8d9ad265e27e9d086c318ae76d6df824783b29cef980606a
MD5 ea7b771cdb10c18bdffc73e7f320b030
BLAKE2b-256 b7f84c1a12c9b5b0e46e257665cd9313129c2b57352ad95b0d8a00db366ebfe0

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