A fast, privacy-focused file hashing tool built with Go WebAssembly and React. Calculate XXH3 hashes of your files directly in your browser - no files ever leave your device.
π Live Demo
- π 100% Private: All processing happens locally in your browser - files never leave your device
- β‘ Lightning Fast: Powered by Go WebAssembly for optimal performance
- π Multiple Files: Process multiple files at once with sequential processing
- π¨ Modern UI: Clean, responsive interface built with React and Tailwind CSS
- π Cross-Platform: Works on any device with a modern web browser
- π¦ Easy Deployment: Docker support for easy hosting
-
Clone the repository
git clone https://github.com/achintya-7/hash-forge.git cd hash-forge -
Install Node.js dependencies
npm install
-
Build the WebAssembly module
npm run build:wasm
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:5173to use the application.
-
Build the WebAssembly module
npm run build:wasm
-
Build the React application
npm run build
-
Serve the built files
npm run preview
- Build and run with Docker
./docker-build.sh
This project is configured for automatic deployment to GitHub Pages using GitHub Actions.
-
Fork or clone this repository to your GitHub account
-
Enable GitHub Pages in your repository:
- Go to your repository settings
- Navigate to "Pages" section
- Under "Source", select "GitHub Actions"
-
Push to the master branch:
git add . git commit -m "Deploy to GitHub Pages" git push origin master
-
Access your deployed app: Your app will be available at:
https://yourusername.github.io/hash-forge/
If you prefer to deploy manually:
-
Build the project locally:
npm run deploy
-
Deploy using GitHub CLI (if installed):
gh workflow run deploy.yml
-
Build the Docker image
docker build -t hash-forge . -
Run the container
docker run -p 3000:80 --name hash-forge-container hash-forge
-
Access the application Open
http://localhost:3000in your browser.
# Stop the container
docker stop hash-forge-container
# Remove the container
docker rm hash-forge-container
# View logs
docker logs hash-forge-containerhash-forge/
βββ go/ # Go WebAssembly source
β βββ main.go # Main WASM entry point
β βββ go.mod # Go module definition
β βββ go.sum # Go module checksums
βββ src/ # React source code
β βββ App.tsx # Main React component
β βββ components/ # UI components
β βββ lib/ # Utility functions
βββ public/ # Static files
β βββ main.wasm # Compiled WebAssembly binary
β βββ wasm_exec.js # Go WebAssembly runtime
βββ Dockerfile # Multi-stage Docker build
βββ docker-build.sh # Docker build script
βββ package.json # Node.js dependencies
npm run dev- Start development servernpm run build:wasm- Build Go WebAssembly modulenpm run build- Build production React appnpm run preview- Preview production build
./docker-build.sh- Build and run Docker containernpm run docker-build-and-run- Same as above
npm run lint- Run ESLint
- Go 1.24: Core language for WebAssembly compilation
- XXH3: Fast, high-quality hash algorithm via zeebo/xxh3
- syscall/js: Go's WebAssembly browser interface
- React 19.1: Modern UI framework with hooks
- TypeScript: Type-safe JavaScript development
- Vite: Fast build tool and development server
- Tailwind CSS: Utility-first CSS framework
- shadcn/ui: Beautiful, accessible UI components
- Docker: Multi-stage containerized deployment
- nginx: Production web server
- ESLint: Code linting and formatting
- File Selection: Choose one or more files using the file input
- WebAssembly Loading: Go WASM module loads in the browser
- Hash Calculation: Files are processed locally using the XXH3 algorithm
- Results Display: Hash results are shown with copy functionality
The Go code is compiled to WebAssembly and exposes a hashFile function:
func hashFile(this js.Value, args []js.Value) interface{} {
// File processing logic
fileData := args[0]
buffer := make([]byte, fileData.Get("length").Int())
js.CopyBytesToGo(buffer, fileData)
// Calculate hash
finalHash := xxh3.Hash(buffer)
return fmt.Sprintf("%d", finalHash)
}The React frontend calls this function:
const hash = window.hashFile(uint8Array);- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- XXH3 - The fast hashing algorithm
- zeebo/xxh3 - Go implementation of XXH3
- shadcn/ui - Beautiful UI components
- Go WebAssembly - Go's WebAssembly support
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Contact the maintainer: @achintya-7
Made with β€οΈ by Achintya