Skip to main content

Returns the MD5, SHA1, SHA256, SHA384, or SHA512 checksum of a file.

Project description

Simple File Checksum Logo

Simple File Checksum

Returns the MD5, SHA1, SHA256, SHA384, or SHA512 checksum of a file


Tests Badge License: MIT Supported Platforms PyPI Supported Versions PyPI PyPI Status Downloads

Installation

Run the following to install:

pip3 install simple-file-checksum

Usage

Python:

>>> from simple_file_checksum import get_checksum
>>> get_checksum("tst/file.txt")
'9e107d9d372bb6826bd81d3542a419d6'
>>> get_checksum("tst/file.txt", algorithm="MD5")
'9e107d9d372bb6826bd81d3542a419d6'
>>> get_checksum("tst/file.txt", algorithm="SHA1")
'2fd4e1c67a2d28fced849ee1bb76e7391b93eb12'
>>> get_checksum("tst/file.txt", algorithm="SHA256")
'd7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592'
>>> get_checksum("tst/file.txt", algorithm="SHA384")
'ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1'
>>> get_checksum("tst/file.txt", algorithm="SHA512")
'07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6'

Terminal:

$ simple-file-checksum tst/file.txt
9e107d9d372bb6826bd81d3542a419d6
$ simple-file-checksum tst/file.txt -a MD5
9e107d9d372bb6826bd81d3542a419d6
$ simple-file-checksum tst/file.txt -a SHA1
2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
$ simple-file-checksum tst/file.txt -a SHA256
d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592
$ simple-file-checksum tst/file.txt -a SHA384
ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1
$ simple-file-checksum tst/file.txt -a SHA512
07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6

Developing

To install simple-file-checksum, along with the tools you need to develop and run tests, run the following:

pip3 install -e ".[dev]"

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

simple_file_checksum-1.3.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

simple_file_checksum-1.3.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file simple_file_checksum-1.3.0.tar.gz.

File metadata

  • Download URL: simple_file_checksum-1.3.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for simple_file_checksum-1.3.0.tar.gz
Algorithm Hash digest
SHA256 4451082aea788c3c78ce5535b355f795e15a6d594553e6da5b526c77bd0b1a67
MD5 914a5b9bb203442585059217d923bae9
BLAKE2b-256 2d745778fbce78bad2203842c652435608e311bf60f62a52f4875bf0e6d22a89

See more details on using hashes here.

File details

Details for the file simple_file_checksum-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_file_checksum-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2785a9a09ea8b1763cd2a1dce14e51306a51398979e21e15a61bfd6342c919b
MD5 e41edf12ada84e7c0d88e89808490b03
BLAKE2b-256 78161a10daa68dd4c55a68e419f2601d399ad06e9c01831c449b76c62a67902b

See more details on using hashes here.

Supported by

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