Skip to main content

A faster MD5 sum calculator that uses concurrency.

Project description

fmd5sum

This script will use Python’s hashlib library, which provides the MD5 functionality, and try to optimize the file reading and hashing process using buffers and possibly concurrency.

How It Works

  • Hash Function: Uses hashlib.md5() to create a new MD5 hash object.
  • File Reading: Reads the file in chunks (specified by blocksize) to handle large files efficiently.
  • Concurrency: Utilizes ThreadPoolExecutor from Python's concurrent.futures module to hash multiple files in parallel, which can significantly speed up the process when dealing with multiple files on multi-core processors.
  • Error Handling: Gracefully handles errors such as missing files or read permissions.

Usage

You would run this script from the command line, providing the files you wish to hash as arguments. For example:

python fmd5sum.py file1.txt file2.txt

This command will print the MD5 hashes of file1.txt and file2.txt.

Notes

  • Performance: While this script adds concurrency, its performance benefit will primarily be seen when processing multiple files due to the overhead of starting Python and loading libraries. The read operation's optimization (by using a large block size) also helps with very large files. Installation: Make sure you have Python installed on your system to use this script. Most Linux systems have Python installed by default.
  • Limitations: For single, especially smaller, files, the original md5sum might still outperform this script due to the overhead of Python.

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

fmd5sum-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

fmd5sum-0.1.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file fmd5sum-0.1.0.tar.gz.

File metadata

  • Download URL: fmd5sum-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for fmd5sum-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6a910fb6c0c6fdf7918c8fc7585d1b19d94f80cd1af14044e433e7fac25e1fe3
MD5 58ca88f204367ef8bbbd8c889147cbb7
BLAKE2b-256 2c0f4dfc5f2175f26580684d6616f3ad955dd8dbffa10ad3fa7a20f3512b0096

See more details on using hashes here.

File details

Details for the file fmd5sum-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fmd5sum-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for fmd5sum-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1bb0f4c8273217f6a12c1e1077974346b8d1fe3b7afc2f3dcefb3f2d6d201f7a
MD5 896c941c35342bbcd1e9ff9fd9245242
BLAKE2b-256 6976b63634296861675150228a2d3ccc51072252109bc10bf3fcbb9563ce426d

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