fmd5sum
fmd5sum is a small, cross-platform command-line tool and Python library for
calculating standard MD5 checksums. It processes multiple files concurrently,
keeps output in input order, and returns a non-zero exit status if any file
cannot be read.
[!WARNING] MD5 is not collision resistant. Use this tool for compatibility and non-adversarial file integrity checks, not for passwords, signatures, or security-sensitive verification.
Requirements
- Python 3.10 or newer
- Windows, macOS, or Linux
- No runtime dependencies outside the Python standard library
Installation
Install the command with pipx
This is the recommended option for end users because it keeps the command in an isolated environment:
pipx install fmd5sum
fmd5sum --help
Install with pip
python -m pip install fmd5sum
Install from source
Clone the repository, create a virtual environment, and install the project.
Windows PowerShell:
git clone https://github.com/jlchen5/fmd5sum.git
cd fmd5sum
py -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install .
macOS or Linux:
git clone https://github.com/jlchen5/fmd5sum.git
cd fmd5sum
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install .
Install with Conda
conda env create -f environment.yml
conda activate fmd5sum-env
Usage
Calculate one or more checksums:
fmd5sum file1.txt file2.img
Wildcard patterns are expanded by fmd5sum, including on Windows shells that
do not expand them. Quote the pattern to get consistent behavior:
fmd5sum "images/*.jpg" "images/*.png"
Choose the worker count and read block size:
fmd5sum --workers 4 --blocksize 1048576 file1.iso file2.iso
The package can also be run without installing its console script:
python -m fmd5sum file1.txt file2.img
Run fmd5sum --help for all options. A successful run returns exit code 0.
If one or more files cannot be processed, valid checksums are still printed and
the command returns exit code 1. Invalid arguments return exit code 2.
Python API
from fmd5sum import md5sum, process_files
checksum = md5sum("path/to/file.ext")
status = process_files(["file1.txt", "file2.img"], max_workers=4)
md5sum() returns None and reports an error to stderr when the file cannot
be read. It raises ValueError when blocksize is not positive.
process_files() returns a command-style status code: 0 for success and 1
when at least one file failed.
Performance
Concurrency is applied across independent files. A single file is read by one
worker because standard MD5 has a sequential chaining dependency. The default
worker count is capped at eight and never exceeds the number of input files or
available CPUs. Use --workers to tune throughput for the storage device.
Thread-based workers avoid multiprocessing startup and serialization overhead, especially on Windows and macOS. Actual throughput depends mainly on storage, file sizes, cache state, and the number of independent devices. Benchmark with representative data before increasing concurrency.
Development and packaging
Install development dependencies and run the tests:
python -m pip install -e ".[dev]"
python -m pytest
Build a platform-independent wheel and source archive:
python -m build
The artifacts are written to dist/. The generated py3-none-any wheel can be
installed on Windows, macOS, and Linux with a supported Python version.
License
This project is licensed under the MIT License. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fmd5sum-0.3.0.tar.gz.
File metadata
- Download URL: fmd5sum-0.3.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9fea14f51c8d9189ed12727bb0698566531f02c5916d5cf898790dcf8502d66
|
|
| MD5 |
dff5bf1d24015047a57263769ab8f5b4
|
|
| BLAKE2b-256 |
ef2791a10455af850abb30a3730edd175d8973eb8e5f7207874bedc7bc32e5ec
|
Provenance
The following attestation bundles were made for fmd5sum-0.3.0.tar.gz:
Publisher:
publish-pypi.yml on jlchen5/fmd5sum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fmd5sum-0.3.0.tar.gz -
Subject digest:
c9fea14f51c8d9189ed12727bb0698566531f02c5916d5cf898790dcf8502d66 - Sigstore transparency entry: 2582671396
- Sigstore integration time:
-
Permalink:
jlchen5/fmd5sum@14c684028b1360a6810b875e62d5f192f4699a5c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jlchen5
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@14c684028b1360a6810b875e62d5f192f4699a5c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fmd5sum-0.3.0-py3-none-any.whl.
File metadata
- Download URL: fmd5sum-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5a9a0ebb76314457aeddf328c56b8e09165318f6885dd0e069fb934941af7b9
|
|
| MD5 |
4120a84b61e190fd1f9ac90a0f9b6bde
|
|
| BLAKE2b-256 |
a16927cd4fe3ff0828ddf447e2d04dc7d8b7243e348cffe07330f0f78e3609e3
|
Provenance
The following attestation bundles were made for fmd5sum-0.3.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on jlchen5/fmd5sum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fmd5sum-0.3.0-py3-none-any.whl -
Subject digest:
a5a9a0ebb76314457aeddf328c56b8e09165318f6885dd0e069fb934941af7b9 - Sigstore transparency entry: 2582671401
- Sigstore integration time:
-
Permalink:
jlchen5/fmd5sum@14c684028b1360a6810b875e62d5f192f4699a5c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jlchen5
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@14c684028b1360a6810b875e62d5f192f4699a5c -
Trigger Event:
workflow_dispatch
-
Statement type: