Crates.io | digestify |
lib.rs | digestify |
version | 0.4.0 |
source | src |
created_at | 2021-06-04 21:50:19.784258 |
updated_at | 2022-07-02 03:07:44.531754 |
description | Verify a file against a provided digest/hash/checksum. |
homepage | https://github.com/evaneaston/digestify |
repository | https://github.com/evaneaston/digestify |
max_upload_size | |
id | 406264 |
size | 35,732 |
digest·i·fy -| _ˈdī-ˌjest-ə-ˌfī
noun - A command line tool to make verification of digests/checksums/hashes on downloaded files a little easier. Just specity the file and the hash listed on the download host. It will infer the possible digest algorithm(s) from the length. It's process exit code will be indicate whether the digest matches.
verb - Portmanteau of digest and verify. Compute a digest of a file and verify that the digest matches a provided value.
Algorithm |
Bit Length |
Hexadecimal Length |
---|---|---|
SHA-512 | 512 | 128 |
SHA-256 | 256 | 64 |
SHA-1 | 160 | 40 |
MD5 | 128 | 32 |
CRC-32 | 32 | 8 |
$ digestify -h
digestify 0.4.0
Verify a file against a provided digest/hash/checksum.
USAGE:
digestify <file> <digest>
ARGS:
<file> File to verify
<digest> Digest to compare to, specified as a case-insensitive hexadecimal string
OPTIONS:
-h, --help Print help information
-V, --version Print version information
If a match is found against one of the digest algorithms, the command will succeed. Otherwise, it will fail.
# digestify Cargo.lock 19189c1219285b61ce1e95f9e4fdd5354a926075db9cf5dc62cf1801702c67d2
Verifying 'Cargo.lock' against provided digest of size 64 hex chars / 256 bits. Candidate digest(s): SHA-256.
SHA-256: PASS
Expected=19189c1219285b61ce1e95f9e4fdd5354a926075db9cf5dc62cf1801702c67d2
Actual=19189c1219285b61ce1e95f9e4fdd5354a926075db9cf5dc62cf1801702c67d2
PASS: Provided digest matches the content.
# echo $?
0
# digestify Cargo.toml f26c2e4e001349b737a3a5cc5fc4afc87b423773
Verifying 'Cargo.toml' against provided digest of size 40 hex chars / 160 bits. Candidate digest(s): SHA-1.
SHA-1: FAIL
Expected=f26c2e4e001349b737a3a5cc5fc4afc87b423773
Actual=95ee03e733a0111ac9d6b2073f4acec0f120fae5
FAIL: Provided digest doesn't match any of the candidate digest results.
# echo $?
2