{"id":18858281,"url":"https://github.com/metaphorme/ezcheck","last_synced_at":"2025-08-10T07:05:57.622Z","repository":{"id":261279666,"uuid":"883836990","full_name":"Metaphorme/ezcheck","owner":"Metaphorme","description":"An easy-to-use, lightweight, cross-platform, and high-performance tool for calculating, comparing, and verifying hash of strings and files.","archived":false,"fork":false,"pushed_at":"2025-07-17T09:05:59.000Z","size":9218,"stargazers_count":20,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-27T16:17:21.225Z","etag":null,"topics":["hash","md2","md4","md5","sha1","sha224","sha256","sha384","sha512","verify","xxhash"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/ezcheck","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Metaphorme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-05T16:54:13.000Z","updated_at":"2025-07-17T09:05:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"5eb80846-83d5-43d1-9e3b-9639464bf88c","html_url":"https://github.com/Metaphorme/ezcheck","commit_stats":null,"previous_names":["metaphorme/ezcheck"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Metaphorme/ezcheck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Metaphorme%2Fezcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Metaphorme%2Fezcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Metaphorme%2Fezcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Metaphorme%2Fezcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Metaphorme","download_url":"https://codeload.github.com/Metaphorme/ezcheck/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Metaphorme%2Fezcheck/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269688304,"owners_count":24459438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hash","md2","md4","md5","sha1","sha224","sha256","sha384","sha512","verify","xxhash"],"created_at":"2024-11-08T04:11:41.778Z","updated_at":"2025-08-10T07:05:57.392Z","avatar_url":"https://github.com/Metaphorme.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ezcheck\n\n[![Build](https://github.com/Metaphorme/ezcheck/actions/workflows/build.yml/badge.svg)](https://github.com/Metaphorme/ezcheck/actions/workflows/build.yml)\n[![Test](https://github.com/Metaphorme/ezcheck/actions/workflows/test.yml/badge.svg)](https://github.com/Metaphorme/ezcheck/actions/workflows/test.yml)\n[![Crates.io Version](https://img.shields.io/crates/v/ezcheck?logo=rust)](https://crates.io/crates/ezcheck)\n[![Mirror Gitee](https://img.shields.io/badge/Mirror-Gitee-blue?logo=gitee)](https://gitee.com/metaphorme/ezcheck)\n\n[中文文档](./README_zh.md)\n\nezcheck(easy check) is an easy-to-use, lightweight, cross-platform, and high-performance tool for calculating,\ncomparing, and verifying hash of strings and files. Designed to prevent content tampering and ensure file integrity.\n\nezcheck have three backends: [ring](https://docs.rs/ring), [hashes](https://docs.rs/hashes) and mix\nbackend([ring](https://docs.rs/ring) and [hashes](https://docs.rs/hashes)), and you can only choose\none of them. The main differences between them are:\n\n| Features             | ring                                                       | hashes                                                          | mix(Recommended)                                                                                |\n|----------------------|------------------------------------------------------------|-----------------------------------------------------------------|-------------------------------------------------------------------------------------------------|\n| Speed                | Fast.                                                      | About 5 times slower than ring.                                 | Use the fastest backend that supports the algorithm.                                            | \n| 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, XXHASH32, XXHASH64, XXHASH3_64 |\n| Implement languages  | Assembly, Rust, C and etc..                                | Rust                                                            | Assembly, Rust, C and etc..                                                                     |\n| Compatibility        | May not work on every machine with different architecture. | Works well with Rust.                                           | Same to ring.                                                                                   |\n\n❗️ To achieve both fastest speed and maximum compatibility, the default backend is **mix backend**.\n\n⚠️ Please notice that although ezcheck supports a lot of hash algorithms, `MD2`, `MD4`, `MD5`, `SHA1` are proven to be\n**insecure**. ezcheck still provides them for maximum compatibility, but **it does not recommend users continue to use\nthem**.\n\n## Setup\n\n### Direct Binary Download\n\nDownload the suitable **mix backend** binary from the [release](https://github.com/Metaphorme/ezcheck/releases/latest).\n\n### Install from Cargo\n\n```bash\n$ # mix backend\n$ cargo install ezcheck\n$ # ring backend\n$ cargo install ezcheck --no-default-features --features ring_backend\n$ # hashes backend\n$ cargo install ezcheck --no-default-features --features hashes_backend\n```\n\n### Instantly run ezcheck with x-cmd\n\n[x-cmd](https://x-cmd.com) is a lightweight cross-platform package manager implemented in posix shell. Quickly download\nand execute `ezcheck` with a single command: [`x ezcheck`](https://x-cmd.com/pkg/ezcheck)\n\nYou can also install `ezcheck` in the user level without requiring root privileges:\n\n```bash\n$ x env use ezcheck\n```\n\n### Build from source\n\n[![MSRV](https://img.shields.io/crates/msrv/ezcheck)](./Cargo.toml#L11)\n\n#### Build\n\n```bash\n$ git clone https://github.com/Metaphorme/ezcheck \u0026\u0026 cd ezcheck\n$ # Choose one from mix backend, hashes backend or ring backend\n$ # mix backend\n$ cargo build --release\n$ # ring backend\n$ cargo build --release --no-default-features --features ring_backend\n$ # hashes backend\n$ cargo build --release --no-default-features --features hashes_backend\n$\n$ ./target/release/ezcheck --version\n```\n\n## Run tests\n\n```bash\n$ git clone https://github.com/Metaphorme/ezcheck \u0026\u0026 cd ezcheck\n$ cargo test  # mix backend\n$ cargo test --no-default-features --features ring_backend    # ring backend\n$ cargo test --no-default-features --features hashes_backend  # hashes backend\n```\n\n## Usage\n\nSupported hash algorithms of different backends:\n\n| ring       | hashes     | mix                       |\n|------------|------------|---------------------------|\n|            | MD2        | MD2 (hashes backend)      |\n|            | MD4        | MD4 (hashes backend)      |\n|            | MD5        | MD5 (hashes backend)      |\n|            | SHA1       | SHA1 (hashes backend)     |\n|            | SHA224     | SHA224 (hashes backend)   |\n| SHA256     | SHA256     | SHA256 (ring backend)     |\n| SHA384     | SHA384     | SHA384 (ring backend)     |\n| SHA512     | SHA512     | SHA512 (ring backend)     |\n| SHA512/256 | SHA512/256 | SHA512/256 (ring backend) |\n|            |            | XXHASH32                  |\n|            |            | XXHASH64                  |\n|            |            | XXHASH3_64                |\n\n### Calculate\n\nCalculate hash for file(s) or text.\n\n```bash\n$ # Usage:\n$ #  ezcheck calculate|c [ALGORITHM (Default SHA256)] (-f file(s)/\"-\" for standard input | -t text)\n$\n$ # Examples:\n$ ezcheck c sha256 -f image.jpg\nb4c5e1d0a1f84a07ef6f329d3dcec62bce40103f49d8088e2b1b98a87e4ff0c2  image.jpg\n$\n$ cat image.jpg | ezcheck calculate sha256 -f -\nb4c5e1d0a1f84a07ef6f329d3dcec62bce40103f49d8088e2b1b98a87e4ff0c2  -\n$\n$ ezcheck calculate sha256 -t \"Hello\"\nSHA256:  185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969\n$\n$ ezcheck calculate -f image.jpg\nNo algorithm specified. Using SHA256 as the default.\nb4c5e1d0a1f84a07ef6f329d3dcec62bce40103f49d8088e2b1b98a87e4ff0c2  image.jpg\n$\n$ # We could also redirect the output into a file, just like shasum does.\n$ ezcheck calculate sha256 -f image.jpg \u003e sha256sum.txt\n```\n\n### Compare\n\nCompare with given hash.\n\n```bash\n$ # Usage:\n$ #  ezcheck compare|m [ALGORITHM (Leave blank to automatically detect algorithm)] (-f file/\"-\" for standard input | -t text) -c hash\n$  \n$ # Examples:\n$ ezcheck m sha256 -f image.jpg -c b4c5e1d0a1f84a07ef6f329d3dcec62bce40103f49d8088e2b1b98a87e4ff0c2\nSHA256 OK\n$\n$ cat image.jpg | ezcheck compare sha256 -f - -c b4c5e1d0a1f84a07ef6f329d3dcec62bce40103f49d8088e2b1b98a87e4ff0c2                           \nSHA256 OK\n$\n$ ezcheck compare sha256 -t \"Hello\" -c 085f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969\nSHA256 FAILED  Current Hash:  185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969\n$\n$ # Auto detect hash algorithm\n$ ezcheck compare -f image.jpg -c b68c5da64847c4d8fd046ea6d6b4739f\nINFO: Hash Algorithm could be MD5, MD4, MD2\nMD5 FAILED  Current Hash:  c8d0b68ed0abd920f9388973aa5a926e\nMD4 OK\n```\n\n### Check\n\nCheck with given shasum-style check file.\n\nshasum-style check file could be generated from [shasum](https://linux.die.net/man/1/shasum)\nand [ezcheck](https://github.com/Metaphorme/ezcheck). It looks like:\n\n```\n00691413c731ee37f551bfaca6a34b8443b3e85d7c0816a6fe90aa8fc8eaec95  滕王阁序.txt\nb4c5e1d0a1f84a07ef6f329d3dcec62bce40103f49d8088e2b1b98a87e4ff0c2 *image.jpg\n```\n\n```bash\n$ # Usage:\n$ #  ezcheck check|k [ALGORITHM (Leave blank to automatically detect algorithm)] -c check-file\n$\n$ # Warning: The shasum file (or check file) should be in the same directory with files to be checked.\n$ # Example:\n$ ezcheck k sha256 -c sha256sum.txt \n滕王阁序.txt: SHA256 OK\nimage.jpg: SHA256 OK\n$\n$ # Auto detect hash algorithm\n$ cat md4sum.txt\n9ec44ac67ab1e1c98fe0406478d5297d  滕王阁序.txt\nb68c5da64847c4d8fd046ea6d6b4739f  image.jpg\n$ ezcheck check -c md4sum.txt\n滕王阁序.txt: MD5 FAILED  Current Hash:  07c4e6a2c2db5f2d3a8998a3dba84a96\n滕王阁序.txt: MD4 OK\nimage.jpg: MD5 FAILED  Current Hash:  c8d0b68ed0abd920f9388973aa5a926e\nimage.jpg: MD4 OK\n$\n$ # Actually, ezcheck supports various algorithm in the same check file in auto detect.\n$ # 🤔 But why this happens?\n$ cat sha256sum.txt\n00691413c731ee37f551bfaca6a34b8443b3e85d7c0816a6fe90aa8fc8eaec95  滕王阁序.txt\nb4c5e1d0a1f84a07ef6f329d3dcec62bce40103f49d8088e2b1b98a87e4ff0c2 *image.jpg\n9ec44ac67ab1e1c98fe0406478d5297d  滕王阁序.txt\n$\n$ ezcheck check -c sha256sum.txt\n滕王阁序.txt: SHA256 OK\nimage.jpg: SHA256 OK\n滕王阁序.txt: MD5 FAILED  Current Hash:  07c4e6a2c2db5f2d3a8998a3dba84a96\n滕王阁序.txt: MD4 OK\n```\n\n## Benchmark\n\n### SHA256 Benchmark Tests\n\n#### Method\n\n* Device: MacBook Air M1 8GB\n\n* Steps\n\n    1. Run and repeat 3 times:\n        ```bash\n        $ count=10000  # Test size = 1MiB * $count\n        $ # Bare, Speed of generating the data\n        $ dd if=/dev/zero bs=1M count=$count | pv \u003e /dev/null\n        $ # ezcheck-hashes\n        $ dd if=/dev/zero bs=1M count=$count | pv | ./ezcheck-hashes calculate sha256 -f -\n        $ # ezcheck-ring\n        $ dd if=/dev/zero bs=1M count=$count | pv | ./ezcheck-ring calculate sha256 -f -\n        $ # sha256sum\n        $ dd if=/dev/zero bs=1M count=$count | pv | sha256sum\n        ```\n\n    2. Calculate the average value.\n\n#### Result\n\n| Implementation / Speed(GiB/s) / Test size(MiB) | 1    | 100  | 500  | 1000 | 5000 | 10000 |\n|------------------------------------------------|------|------|------|------|------|-------|\n| Bare (Speed of generating the data)            | 2.13 | 3.02 | 4.59 | 5.31 | 5.97 | 6.07  |\n| ezcheck-hashes                                 | 0.13 | 0.28 | 0.29 | 0.30 | 0.30 | 0.30  |\n| ezcheck-ring                                   | 0.58 | 1.24 | 1.57 | 1.63 | 1.68 | 1.68  |\n| sha256sum                                      | 0.73 | 1.26 | 1.63 | 1.69 | 1.75 | 1.81  |\n\n![benchmark](./benchmark-sha256.png)\n\n### Speed vs. Algorithms, Implementations\n\n#### Method\n\n* Device: MacBook Air M1 8GB\n\n* Steps\n\n    1. Run:\n        ```bash\n        $ algorithm=sha256\n        $ # ezcheck-hashes\n        $ dd if=/dev/zero bs=1M count=10000 | pv | ./ezcheck-hashes calculate $algorithm -f -\n        $ # ezcheck-ring\n        $ dd if=/dev/zero bs=1M count=10000 | pv | ./ezcheck-ring calculate $algorithm -f -\n        $ # ezcheck-mix\n        $ dd if=/dev/zero bs=1M count=10000 | pv | ./ezcheck-mix calculate $algorithm -f -\n        ```\n    2. Calculate the average value.\n\n#### Result\n\n| Algorithms / Speed(GiB/s) / Implementations | ring   | hashes   | mix      |\n|---------------------------------------------|--------|----------|----------|\n| MD2                                         | \tnull* | \t0.00896 | \t0.00896 |\n| MD4                                         | \tnull* | \t0.852   | \t0.852   |               \n| MD5                                         | \tnull* | \t0.549   | \t0.549   |                     \n| SHA1                                        | \tnull* | \t0.802   | \t0.802   |                      \n| SHA224\t                                     | null*  | \t0.299   | \t0.299   |                  \n| SHA256                                      | \t1.69\t | 0.298    | \t1.70    |                   \n| SHA384                                      | \t1.12\t | 0.473    | \t1.13    |                   \n| SHA512\t                                     | 1.13\t  | 0.473    | \t1.13    |                   \n| SHA512/256                                  | \t1.13\t | 0.473    | \t1.13    |               \n| XXHASH32\t                                   | null*\t | null*\t   | 2.45     |               \n| XXHASH64\t                                   | null*\t | null*\t   | 3.27     |               \n| XXHASH3_64\t                                 | null*  | \tnull*   | \t3.65    |    \n\n_null*: The algorithm is not implemented in this implementation._\n\n![benchmark](./benchmark-algorithms-implementations.png)\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2024 Heqi Liu\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaphorme%2Fezcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetaphorme%2Fezcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaphorme%2Fezcheck/lists"}