{"id":25890908,"url":"https://github.com/javalux/hashguard","last_synced_at":"2026-02-06T22:03:06.166Z","repository":{"id":185525593,"uuid":"673482638","full_name":"javaLux/hashguard","owner":"javaLux","description":"Command-Line tool for ensuring the integrity of files using hash sums","archived":false,"fork":false,"pushed_at":"2025-08-30T22:02:47.000Z","size":9453,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-30T23:01:08.422Z","etag":null,"topics":["cli","file","hash","rust","verify"],"latest_commit_sha":null,"homepage":"","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/javaLux.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-08-01T18:16:08.000Z","updated_at":"2025-09-04T13:57:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"d443b305-988d-40bd-a15b-2e2ce68fd505","html_url":"https://github.com/javaLux/hashguard","commit_stats":null,"previous_names":["javalux/hashguard"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/javaLux/hashguard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javaLux%2Fhashguard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javaLux%2Fhashguard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javaLux%2Fhashguard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javaLux%2Fhashguard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javaLux","download_url":"https://codeload.github.com/javaLux/hashguard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javaLux%2Fhashguard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29178566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T20:14:21.878Z","status":"ssl_error","status_checked_at":"2026-02-06T20:14:21.443Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli","file","hash","rust","verify"],"created_at":"2025-03-02T19:30:44.559Z","updated_at":"2026-02-06T22:03:06.161Z","avatar_url":"https://github.com/javaLux.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hashguard\n[![Build Status](https://github.com/javaLux/hashguard/actions/workflows/ci.yml/badge.svg)](https://github.com/javaLux/hashguard/actions)\n[![dependency status](https://deps.rs/repo/github/javaLux/hashguard/status.svg)](https://deps.rs/repo/github/javaLux/hashguard)\n[![GitHub license](https://img.shields.io/github/license/javaLux/hashguard.svg)](https://github.com/javaLux/hashguard/blob/main/LICENSE)\n[![crates.io](https://img.shields.io/crates/v/hashguard.svg)](https://crates.io/crates/hashguard)\n![maintenance-status](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg)\n\nCommand-Line tool for ensuring the integrity of files using hash sums\n\n```\n  ___ ___               .__      ________                       .___\n /   |   \\_____    _____|  |__  /  _____/ __ _______ _______  __| _/\n/    ~    \\__  \\  /  ___/  |  \\/   \\  ___|  |  \\__  \\\\_  __ \\/ __ | \n\\    Y    // __ \\_\\___ \\|   Y  \\    \\_\\  \\  |  // __ \\|  | \\/ /_/ | \n \\___|_  /(____  /____  \u003e___|  /\\______  /____/(____  /__|  \\____ | \n       \\/      \\/     \\/     \\/        \\/           \\/           \\/ \n```\n\n\n# Overview\nHashGuard is a lean and efficient command-line tool designed to simplify the process of downloading files from the internet and ensuring their integrity using hash sums. With HashGuard, you can confidently download files and verify their authenticity, providing an extra layer of security to your downloads. It is also possible to verify files and directories on the local system.\n\n![Hashguard-Demo](../assets/hashguard-demo.gif?raw=true)\n\n## Features\n* ### Download-Command\n  * Download a file and have a specific hash sum calculated depending on the selected hash algorithm\n  * Or you can directly enter a known hash to compare it after the download.\n    This allows you to check whether the file was changed during the download process\n  * **_Notice_**\n    * If you use the download command, please enclose the URL in double quotation marks.\n      Because by enclosing the URL in double quotation marks, you tell the shell to treat the entire string as a single argument, even if it contains spaces or other special characters. This can prevent errors and unexpected behavior in your shell.\n  \n* ### Local-Command\n  * Allows to hash local files, directories or any byte-buffer (furthermore you can also compare with a specific hash)\n  * **Options**\n    * _include-names_\n        * Enables the inclusion of file and directory names for the calculation of the hash sum. This option only has an effect in conjunction with the ``--path`` option\n    * _path_\n      * Calculate a hash sum from a file/dir\n    * _buffer_\n      * Calculate a hash sum from any given byte buffer\n      * What means byte buffer?\n        * For example, you can calculate a hash sum from any text that is provided as a ``String``\n        * As described in the download command, please enclose the text to be hashed in double quotation marks. This prevents unexpected behavior in your shell.\n  * _Notice_\n    * You can only use one option per call. So either ``path`` or ``buffer``\n\n\n* **Hash Verification:** Verify the authenticity of downloaded or local files by comparing their hash with a specified hash. Any mismatched hash digits\nwill be highlighted (only if colored output is not disabled).\n* **Support for Various Hash Algorithms:** HashGuard supports different hash algorithms, including SHA-2, SHA-3 family. The default Hash-Algorithm is SHA2-256.\n* **Intuitive Command-Line Interface:** The simple and user-friendly CLI lets you easily calculate and compare hash sums.\n* **Enable or Disable colored output**\n* **Logging**\n  * To enable logging, set one of the following log level options: [ `-l=debug|info`, `--logging=debug|info` ]\n    * `debug` log level: write all available information to the log file\n      * For example, if you use the `download` command, the whole http request and response is logged\n    * `info` log level: write only necessary information to the log file (e.g. common application operations and error messages)\n\n## Supported OS\n* Linux\n* MacOs\n* Windows 10/11\n\n## Installation\n### Requirements\n#### Installing Rust\nTo install Rust on your system, just go to the [official Rust website](https://www.rust-lang.org/tools/install), download and install the Rustup toolchain manager.\n\n**Notice:**\nPlease refer to the installation instructions for your operating system. For certain operating systems, build tools need to be installed before you can use Rust.\n\nHashGuard is available on [crates.io](https://crates.io/crates/hashguard) Rust community's crate registry.\nSo you can easily install it as binary on your local system.\nUse the follow command:\n```\ncargo install hashguard\n```\n### Using Natively Compiled Binaries\nIf you don't have Rust installed or prefer not to build the project yourself, you can use the precompiled binaries provided in the [Releases](https://github.com/javaLux/hashguard/releases) section. Download the appropriate binary for your operating system and architecture, and you're good to go!\n\n- [Download the latest release](https://github.com/javaLux/hashguard/releases/latest)\n\n## Build the project\n\n**_To build this project from scratch follow these steps:_**\n\n* Clone this repository\n* Open a terminal\n* Navigate to the root directory of the project\n* Run the following command\n```\ncargo build --release\n```\n* The compiled binary will be available at `./target/release/`\n\n## How to use\n### General Syntax\n* ``hashguard [OPTIONS] \u003cCOMMAND\u003e``\n\n### Command specific syntax\n* ``hashguard [OPTIONS] download [OPTIONS] \u003cURL\u003e [HASH]``\n* ``hashguard [OPTIONS] local [OPTIONS] [HASH]``\n\n### Passing a Hash\nIf you want to specify a hash for comparison, you can pass it as usual as a string with valid hexadecimal digits.\n* For example:\n  ````shell\n      SHA2-256 Hash\n      \"9e2a73027d72a28e5cb05cf9e87e71d5f5850d047a8b163f92f2189e5e8f42ac\"\n  ````\n\nIt is also possible to add a **_prefix_** to the hash to define the hash algorithm to be used.\n\n* For example:\n  ````shell\n      SHA2-256 Hash with prefix\n      \"sha256:9e2a73027d72a28e5cb05cf9e87e71d5f5850d047a8b163f92f2189e5e8f42ac\"\n  ````\n\u003cbr\u003e\n\n**Supported prefixes:**\n\n| Prefix                 |   Associated algorithm   |\n|------------------------|--------------------------|\n| `sha224`, `sha2-224`, `sha2_224` | SHA2-224 |\n| `sha256`, `sha2-256`, `sha2_256` | SHA2-256 *(Default)* |\n| `sha384`, `sha2-384`, `sha2_384` | SHA2-384 |\n| `sha512`, `sha2-512`, `sha2_512` | SHA2-512 |\n| `sha3-224`, `sha3_224` | SHA3-224 |\n| `sha3-256`, `sha3_256` | SHA3-256 |\n| `sha3-384`, `sha3_384` | SHA3-384 |\n| `sha3-512`, `sha3_512` | SHA3-512 |\n\n\u003e **Note:**  \n\u003e If neither a prefix nor the option ``[-a, --algorithm]`` is specified, **SHA2-256** is automatically used as the default algorithm.\n\u003e If a hash is passed with a prefix, the ``[-a, --algorithm]`` option is ignored by default.\n\n\n### Usage Examples\n\n**Common**\n  * Get version info:\n    ````shell\n    hashguard --version\n    ````\n\n  * Get general help:\n    ````shell\n    hashguard --help\n    ````\n\n  * Get help on a specific command:\n    ````shell\n    hashguard download --help\n    ````\n    ````shell\n    hashguard local --help\n    ````\n\n**Download-Command**\n  * Download a file and verify it with a hash sum by using the default hash algorithm SHA2-256:\n    ````shell\n    hashguard download \"https://example.com/file.zip\" a1b2c3d4e5f6\n    ````\n\n  * Download a file and calculate a hash sum with a specific hash algorithm:\n    ````shell\n    hashguard download \"https://example.com/file.zip\" -a sha2-512\n    ````\n  \n  * Download a file and use a prefixed hash to specify the algorithm:\n    ````shell\n    hashguard download \"https://example.com/file.zip\" sha224:a1b2c3d4e5f6\n    ````\n\n  * Use a specific output directory for the downloaded file:\n    ````shell\n    hashguard download \"https://example.com/image.jpg\" a1b2c3d4e5f6 -o /path/to/output_directory\n    ````\n\n  * Use the --rename option to rename the file to be downloaded:\n    ````shell\n    hashguard download \"https://example.com/image.jpg\" a1b2c3d4e5f6 -r \"my_fancy_new_file.jpg\"\n    ````\n  * Disable colored output:\n    ````shell\n    hashguard -c download \"https://example.com/file.zip\"\n    ````\n\n**Local-Command**\n  * Verify a local file with a hash sum using SHA-3:\n    ````shell\n    hashguard local -p /path/to/local_file.txt a1b2c3d4e5f6 -a sha3-256\n    ````\n\n  * Calculate a hash sum from a given ``String``:\n    ````shell\n    hashguard local -b \"Hello my eager young Padawan\"\n    ````\n\n  * Calculate a hash sum from a local directory with the default hash algorithm:\n    ````shell\n    hashguard local -p /path/to/test_dir\n    ````\n  \n  * Calculate a hash sum from a local file and save the calculated hash to a file:\n    ````shell\n    hashguard -s local -p /path/to/local_file.txt\n    ````\n    * The file containing the calculated hash following by the input source (e.g. Path or the byte buffer)\n    * You find the file in the application data directory.\n\n**Use Logging**\n  * Enable `debug` log level:\n    ````shell\n    hashguard -l debug download \"https://example.com/file.zip\" a1b2c3d4e5f6\n    ````\n  * Enable `info` log level\n    ````shell\n    hashguard -l info local -p /path/to/local_file.txt\n    ````\n  * All logs are written to a log file stored in the application's data directory.\n  * You can find out the application data directory with the [ `-V`, `--version` ] command\n\n### Supported Hash Algorithms\n* SHA2-224\n* SHA2-256\n* SHA2-384\n* SHA2-512\n* SHA3-224\n* SHA3-256\n* SHA3-384\n* SHA3-512\n\n## Notice\n**_No colored console output under windows?_**\n\u003cbr\u003e\nHashGuard of course also works with colored console output (errors = red, hints = yellow, success = green).\u003cbr\u003e\nIf no colored text is displayed in the CMD or PowerShell, instead the ANSI escape sequences before and after an output,\u003cbr\u003e\nthen enabling ANSI escape sequence support may help. Open a CMD or PowerShell as admin and execute following command:\u003cbr\u003e\n```\nreg add HKCU\\Console /v VirtualTerminalLevel /t REG_DWORD /d 1\n```\nThis command adds a registry key that enables the conpty feature, which provides ANSI escape sequence support in the Windows console.\u003cbr\u003e\nPlease re-open the terminal and the colored output should work.\n\n## Contributing\nContributions are very welcome! Whether it's a bug fix, improvement, or new feature — your help is appreciated. To contribute, follow these simple steps:\n\n1. **Fork** this repository.\n2. **Create a new branch** for your changes.\n3. Make your changes, ensuring they are clean and well-documented.\n4. **Commit** your changes with a meaningful message.\n5. **Push** your branch to your fork.\n6. Open a pull request from your branch to the main repository.\n\nPlease ensure your code passes any tests and follows the existing style. If you're not sure where to start, feel free to open an issue and ask!\n\n## License\nHashGuard is released under the MIT License.\n\n## Disclaimer\nWhile HashGuard aims to provide reliable file verification, it is essential to exercise caution when downloading files from the internet or using local files for verification. Always ensure that you trust the source and the provided hash sum before proceeding.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavalux%2Fhashguard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavalux%2Fhashguard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavalux%2Fhashguard/lists"}