File Hasher
A fast and efficient CLI tool for calculating SHA256, SHA1, and MD5 hashes of files with progress indication and colored output. Optimized for performance with streaming support for large files.
Features
- Multiple hash algorithms: SHA256, MD5, SHA1, or all at once
- Streaming support: Efficiently processes large files without loading them into memory
- Hash verification: Verify files against known hash values
- Progress bars: Visual feedback for files larger than 10MB
- Colored output: Easy-to-read terminal output
- Multiple files: Process multiple files in a single command
Installation
From crates.io
From source
Requirements
- Rust 1.70 or later
- Works on Linux, macOS, and Windows
Usage
Basic Usage
Hash a single file with SHA256 (default):
Multiple Files
Hash multiple files at once:
Algorithm Selection
Choose a specific hash algorithm:
Calculate all hash types at once:
Hash Verification
Verify a file against a known hash:
Verify with a specific algorithm:
Examples
# Hash a large file (shows progress bar)
# Hash multiple files with all algorithms
# Verify a downloaded file
Development
Running Tests
Code Quality Checks
CI/CD
The project includes GitHub Actions workflows that run on every push and pull request:
- Run all tests
- Check code with clippy
- Verify code formatting
Performance
File Hasher is optimized for speed and memory efficiency:
- Streaming: Processes files in chunks, using minimal memory regardless of file size
- Progress indication: Automatic progress bars for files larger than 10MB
- Multi-algorithm efficiency: When using
--algorithm all, file is read only once - Benchmarks: Can hash a 1GB file in under 3 seconds on modern hardware (SHA256)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.