Skip to content

Feat: File Integrity Checker#165

Merged
peckz merged 2 commits into
jamdotdev:mainfrom
hariharjeevan:feat/file-integrity
Jul 17, 2026
Merged

Feat: File Integrity Checker#165
peckz merged 2 commits into
jamdotdev:mainfrom
hariharjeevan:feat/file-integrity

Conversation

@hariharjeevan

Copy link
Copy Markdown
Contributor

Summary

Adds a new File Integrity Checker utility that lets users generate SHA-256, SHA-512, or MD5 hashes for any local file and verify them against a known hash; No file size limits.

Features

  • Chunked hashing (hashFileChunked): reads the file in 8MB slices via file.slice() and streams each chunk into crypto.createHash, so memory usage stays constant regardless of file size.
  • Algorithm selector (SHA-256 / SHA-512 / MD5). Switching algorithms after a hash has already been computed triggers a fresh read + hash for the newly selected algorithm rather than reusing stale state.

Testing

Added file-integrity-checker.test.tsx covering:

  • Uploading a file automatically computes and displays the SHA-256 hash (default algorithm) without requiring a manual "compute" action.
  • Switching the algorithm selector (e.g. to MD5) clears the stale SHA-256 hash and recomputes/display the correct-length hash for the newly selected algorithm.
  • Tested hash generation for a 11 GB file.

Screenshot

Screenshot from 2026-07-07 10-53-07

@peckz

peckz commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Thank you @hariharjeevan appreciate the effort!

@peckz
peckz merged commit 376bf28 into jamdotdev:main Jul 17, 2026
1 check passed
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.

2 participants