About
File hash checker represents a minimal solution meeting the following requirements:
- Calculate the SHA256 hashes of one or more files in sequence (for loop,
iterator) or parallel (threading, messaging,
rayonparallel iterator) - Provide library API
- Benchmarks via
criterion - Minimal dependencies:
sha2,anyhow,clap,rayon - Provide a CLI utiility:
- Simpler and more straightforward usage than
sha256sum - Save the SHA256 hash to an adjacent
.sha256file (if it doesn't already exist) - Compare the current SHA256 hash to an adjacent
.sha256file (if it exists)
- Simpler and more straightforward usage than
Usage
$ fhc -h
File hash checker (SHA256)
Usage: fhc [OPTIONS] [FILES]...
Arguments:
[FILES]... File(s)
Options:
-p, --process <PROCESS> Process option [default: messaging] [possible values:
sequential-for-loop, sequential-iter, threading,
messaging, rayon-par-iter]
-h, --help Print help
-V, --version Print version
Example
- Run
fhcagainst one or more files to calculate and print the SHA256 hash for each file to stdout and save in adjacent.sha256files. - At any later point, run
fhcagainst one or more files with adjacent.sha256files to re-calculate the SHA256 hash for each file and reportOKif the hashes match andFAILEDif the hashes do not match.
Benchmark
Changelog
- 0.1.0 (2020-02-03): Initial release
- 0.2.1 (2020-02-09): Produce
.sha256files compatible w/sha256sum -c - 0.2.2 (2020-11-18): Update sha2 crate version
- 0.3.0 (2024-01-07): Modernize
- 0.4.0 (2024-01-24): Rename
sequentialprocess option tosequentialforloop; addsequentialiterandrayonpariterprocess options; move most of process option logic from CLI to library via process option functions and the process optionrunmethod; addcriterionbenchmarks; fix changelog; update dependencies- 0.4.1 (2024-01-24): Fix readme
- 0.4.2 (2024-01-24): Fix changelog