ezcheck
ezcheck(easy check) is an ergonomic, standard-output command-line tool for calculating, comparing, and verifying the hash of strings and files.
ezcheck have two backends: ring, hashes and mix backend(ring and hashes), and you can only choose one of them. The main differences between them are:
| Features | ring | hashes | mix |
|---|---|---|---|
| Speed | Fast | About 5 times slower than ring. | Use the fastest backend that supports the algorithm. |
| Supported algorithms | SHA256, SHA384, SHA512, SHA512/256 | MD2, MD4, MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA512/256 | MD2, MD4, MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA512/256 |
| Implement languages | Assembly, Rust, C and etc.. | Rust | Assembly, Rust, C and etc.. |
| Compatibility | May not work on every machine with different architecture. | Works well with Rust. | Same to ring. |
❗️ To achieve both fastest speed and maximum compatibility, the default backend is mix backend.
⚠️ Please notice that although ezcheck supports a lot of hash algorithms, MD2, MD4, MD5, SHA1 are proven to be
insecure. ezcheck still provides them for maximum compatibility, but it does not recommend users continue to use
them.
Setup
Install from binary
Download suitable binary from release.
Install from Cargo
Build from source
Requirements
Build
&&
Run tests
&&
Usage
Supported hash algorithms of different backends:
| ring | hashes | mix |
|---|---|---|
| MD2 | MD2 (hashes backend) | |
| MD4 | MD4 (hashes backend) | |
| MD5 | MD5 (hashes backend) | |
| SHA1 | SHA1 (hashes backend) | |
| SHA224 | SHA224 (hashes backend) | |
| SHA256 | SHA256 | SHA256 (ring backend) |
| SHA384 | SHA384 | SHA384 (ring backend) |
| SHA512 | SHA512 | SHA512 (ring backend) |
| SHA512/256 | SHA512/256 | SHA512/256 (ring backend) |
Calculate
Calculate hash for a file or text.
|
Compare
Compare with given hash.
|
Check
Check with given shasum file.
shasum file could be generated from shasum and ezcheck. It looks like:
00691413c731ee37f551bfaca6a34b8443b3e85d7c0816a6fe90aa8fc8eaec95 滕王阁序.txt
4c03795a6bca220a68eae7c4f136d6247d58671e074bccd58a3b9989da55f56f *image.jpg
Benchmark
Method
-
Device: MacBook Air M1 8GB
-
Steps:
-
Run and repeat 3 times:
| | | | | | | -
Calculate the average value.
Result
| Command/Speed(GiB/s)/Test size(MiB) | 1 | 100 | 500 | 1000 | 5000 | 10000 |
|---|---|---|---|---|---|---|
| Bare | 2.13 | 3.02 | 4.59 | 5.31 | 5.97 | 6.07 |
| ezcheck-hashes | 0.13 | 0.28 | 0.29 | 0.30 | 0.30 | 0.30 |
| ezcheck-ring | 0.58 | 1.24 | 1.57 | 1.63 | 1.68 | 1.68 |
| sha256sum | 0.73 | 1.26 | 1.63 | 1.69 | 1.75 | 1.81 |

License
MIT License
Copyright (c) 2024 Heqi Liu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.