Compare checksums from the command line
Project description
chksum
CLI for comparing two checksums
Install
Requires Python >= 3.10
pip install chksum-cli
Features
- User friendly non-specific argument order
- Visual feedback comparing hashes
- Exit code matches hash results
- Can ignore dot files
- Interactive mode
- Hash only function
- Can use md5, sha1, sha256, and sha512
Usage
CHKSUM [-?] [-i] [-d] position1 position2 [position3]
Calculate and compare the checksums of files or directories.
Can also compare against pasted strings.
ALGORITHMS = ['md5', 'sha1', 'sha256', 'sha512']
positional arguments:
position1 Checksum, file, or algorithm
position2 Checksum, file, or algorithm
position3 Checksum, file, or algorithm
options:
-?, --help Show this help message and exit.
-i, --interactive Run in interactive mode.
-d, --dots Ignore '.' (dot) files from directories.
If the first 2 positional arguments are strings, the algorithm is not needed. Default is md5.
Likewise, passing only a single path will simply out the digest.
Arguments can be passed in any order. [Note: This issue]
E.g. the following are equivalent:
chksum <PathToFile> <PathToDir> sha256 -d
chksum -d <PathToDir> sha256 <PathToFile>
Interactive mode
Use -i
to enter the interactive mode where arguments can be passed one at a time.
Note that -i
is mutually exclusive.
$ chksum -i
_ _
| | | |
___| |__ | | _____ _ _ _ __ ___
/ __| '_ \| |/ / __| | | | '_ ` _ \
| (__| | | | <\__ \ |_| | | | | | |
\___|_| |_|_|\_\___/\__,_|_| |_| |_|
Copyright (c) 2022, espehon
All rights reserved.
ALGORITHMS = ['md5', 'sha1', 'sha256', 'sha512']
Enter Algorithm or path to File or Directory >
Inputs are checked after each entry and the prompt is updated accordingly
Enter Algorithm or path to File or Directory > ./
Directory entered.
Enter Algorithm or path to File or Directory > ./
Directory entered.
Enter Algorithm > md5
Algorithm entered.
Do you want to include '.' (dot) files? [Y/n] > n
include_dots = False
-------------[MD5]--------------
59198d6aad1674a0b372027ce275a9b6
59198d6aad1674a0b372027ce275a9b6
√ Hashes Match
Issues
Using -d
in between positionals can causes an argparse error. (See Issue: #11)
Example:
$ chksum ./file ./file -d sha1
Author
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
Built Distribution
File details
Details for the file chksum-cli-1.1.0.tar.gz
.
File metadata
- Download URL: chksum-cli-1.1.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c89ef5175f9a5de87a4b1b4b09fed8ccc937051f63692e6be797e13f3deb809 |
|
MD5 | 0c226012f5a1536b97c1a44b6199de85 |
|
BLAKE2b-256 | b9ace256b57baa1ac84e7e229c3c9bf51f89a575976a5e80800459e3e0ad3a29 |
File details
Details for the file chksum_cli-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: chksum_cli-1.1.0-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63dc1099604f738bc33662d5fb20006a6955e62d9f1436205ebd6585918132c5 |
|
MD5 | ad9df827a89a7b18266f46521c9fcec2 |
|
BLAKE2b-256 | 1605dbac6d9ea980e5d73de6283ba355fc1b806488b0f3ae143a63773208f2fd |