Skip to content

dcowern/hashure

Repository files navigation

Hashure

A cross-platform file hash comparison tool with both GUI and CLI interfaces.

Features

  • Multiple comparison modes:

    • Single file to single file
    • Multiple files (matched by name)
    • Single folder to single folder
    • Multiple folders (matched by name)
  • Folder comparison options:

    • Recursive or non-recursive traversal
    • Detection of missing files in origin or destination
    • Detection of mismatched files
  • Multiple hash algorithms:

    • MD5
    • SHA-1
    • SHA-256 (default)
    • SHA-512
    • BLAKE2b
    • BLAKE2s
  • Output formats:

    • Human-readable summary
    • JSON for scripting and automation
    • Quiet mode (only show differences)
    • Verbose mode (show full hashes)

Installation

From source

# Clone the repository
git clone https://github.com/yourusername/hashure.git
cd hashure

# Create a virtual environment (recommended)
python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install the package
pip install -e .

Requirements

  • Python 3.9 or higher
  • PyQt6

Usage

GUI Mode

Launch the graphical interface:

# Default - launches GUI when no arguments provided
hashure

# Or explicitly
hashure --gui

CLI Mode

Compare two files

hashure file1.txt file2.txt

Compare two folders (recursive)

hashure -r /path/to/origin /path/to/destination

Compare folders (non-recursive)

hashure /path/to/origin /path/to/destination

Use a different hash algorithm

hashure -a sha512 origin/ destination/

Output as JSON

hashure --json origin/ destination/

Compare multiple files (matched by name)

hashure -m files origin/a.txt origin/b.txt -- dest/a.txt dest/b.txt

Compare multiple folders

hashure -m folders -r folder1 folder2 -- dest_folder1 dest_folder2

Quiet mode (only show differences)

hashure -q origin/ destination/

Verbose mode (show full hashes)

hashure -v origin/ destination/

Exit Codes

  • 0: All files match
  • 1: Differences found (mismatches or missing files)
  • 2: Error occurred

Building Standalone Executables

You can create standalone executables using PyInstaller:

# Install PyInstaller
pip install pyinstaller

# Create executable
pyinstaller --onefile --windowed --name hashure src/hashure/main.py

The executable will be created in the dist/ directory.

Platform-specific builds

Windows:

pyinstaller --onefile --windowed --name hashure.exe src/hashure/main.py

macOS:

pyinstaller --onefile --windowed --name Hashure --osx-bundle-identifier com.hashure.app src/hashure/main.py

Linux:

pyinstaller --onefile --name hashure src/hashure/main.py

Project Structure

hashure/
├── src/
│   └── hashure/
│       ├── __init__.py      # Package initialization
│       ├── main.py          # Entry point
│       ├── cli.py           # Command-line interface
│       ├── gui.py           # PyQt6 graphical interface
│       ├── hasher.py        # Core hashing functionality
│       └── comparator.py    # Comparison logic
├── pyproject.toml           # Project configuration
├── requirements.txt         # Dependencies
├── README.md               # This file
├── LICENSE.md              # GPLv3 license
└── CLAUDE.md               # Development notes for AI assistants

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages