Alpha version!
Everything can change at any time (including flags).
English translation coming soon.
- How can I know my files are not corrupted?
- ...on an old hard drive sitting in the basement?
- ...during a transfer from one hard drive to another?
- ...during usage?
- Which backup is healthier?
- "Wait, there is a conflict between the local version and cloud version on a file I haven't touched in years?"
- Damn cosmic rays!
"Oh, there’s ZFS, which generates the file content checksum automatically."
Oh, really? Try using ZFS on macOS, Windows, or even Linux. Then come back and appreciate the portability of this program.
go install github.com/lucasbalena/picohash@latestpicohashUsing rapidhash
picohash -rapidWithout sidecar files (creates hashes.b3)
picohash -aUsing rapidhash (creates hashes.rph)
picohash -a -rapidSpecify another directory
picohash -a ../storageIf you are using a hard drive
picohash -hddThis will pass the flags --no-mmap --num-threads=1 to b3sum.
If you want to use cat to read the files for some reason
picohash -catpicohash -cUsing the hashes.b3 file
picohash -c -aUsing the hashes.rph file
picohash -c -a -rapidUse -rapid if you hashed with rapidhash. This will change the extension
from .b3 to .rph
Delete all sidecar hash files
picohash -dSplit hashes.b3 into sidecar files
picohash -sJoin the sidecar files into a single hashes.b3
picohash -jIt reads hashes.b3 (if it exists) and adds any new hashes found in the directory to it.
If you want to copy only a subfolder that was hashed with -a, you can split
the hashes, copy the subfolder along with its associated hashes, paste them in
the destination, and then join the hashes. This ensures that all relative paths
remain correct.
Rename a file or directory
- Rename the file.
- Rename the sidecar file.
- Run the following to rewrite the sidecar content to match the new filename.
picohash -rIf you used -a:
picohash -s # Who wants to deal with a long .txt?
# Rename the file and sidecar
picohash -r # Rename the inside contents
# Delete hashes.b3 # To prevent duplicates
picohash -j # Recreate hashes.b3
picohash -d # Delete the sidecar filesOr
picohash -s # Who wants to deal with a long .txt?
# Rename the file
# Delete the sidecar
# Delete hashes.b3 # To prevent duplicates
picohash -j # Recreate hashes.b3
picohash -d # Delete the sidecar files
picohash -a # Hash the renamed filePerhaps there are better ways to handle renaming
The current structure for .b3 and .rph is as follows:
hash name
This format ensures compatibility with other hash-checking programs but requires
using -r to update the sidecar file content to match the new name.
However, even if we change the structure to:
hash
all other steps would still be necessary with you use -a.
In a folder with thousands of files and subfolders, having sidecar files becomes overwhelming.
| Symbol | Meaning |
|---|---|
| ✅ | Passed |
| ❌ | Mismatch |
| 🔍 📂 | File not found (hash exists) |
| 🔍 ⛏️ | Hash not found (file exists) |
| ❗ | Unexpected error (big problem) |
| ⚙️ | Hash generated successfully |
| ⏭️ | Skipped a file already hashed |
| 🤞 | Expected hash (but does not match, appears with ❌) |