Skip to content

Add support for more hash algorithms (SHA-256, SHA-512, SHA-1, MD5) - #2

Merged
achintya-7 merged 6 commits into
masterfrom
support-more-algorithms
May 17, 2026
Merged

Add support for more hash algorithms (SHA-256, SHA-512, SHA-1, MD5)#2
achintya-7 merged 6 commits into
masterfrom
support-more-algorithms

Conversation

@achintya-7

Copy link
Copy Markdown
Owner

Summary

Adds support for multiple hash algorithms from Go's standard library, alongside the existing XXH3. The frontend now includes a dropdown to select which algorithm to use.

Changes

Go Backend (go/main.go)

  • Refactored to support xxh3, SHA-256, SHA-512, SHA-1, and MD5 via a newHasher dispatch function
  • hashFile now accepts an optional second argument for algorithm name (defaults to xxh3)
  • All hashes now return as hex strings (was decimal for xxh3)

Frontend (src/App.tsx)

  • Added algorithm selector dropdown in the upload card
  • Hash results now display a badge showing which algorithm was used
  • Updated copy to reference multiple algorithms instead of just XXH3
  • Info card now lists all available algorithms

Usage

  1. Select a hash algorithm from the dropdown
  2. Choose files
  3. Click "Calculate All Hashes" — each file is hashed with the selected algorithm

Note: Run npm run build:wasm to rebuild the WASM binary before testing.

- Refactor Go WASM backend to support xxh3, SHA-256, SHA-512, SHA-1, MD5
- Add algorithm selector dropdown in frontend
- Update file item display to show which algorithm was used
- Update info card to list all available algorithms
@achintya-7
achintya-7 merged commit c0fa85b into master May 17, 2026
2 of 3 checks passed
@achintya-7
achintya-7 deleted the support-more-algorithms branch May 17, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant