Hash your folder names with SHA-256, restore them anytime.
CLI ยท GUI ยท macOS Right-Click ยท Open Source
English | ไธญๆ
fhash replaces all subfolder names in a directory with short SHA-256 hashes (8 hex characters), while keeping a mapping file so you can restore the original names at any time.
Think of it as a reversible "anonymizer" for folder structures โ useful for privacy, testing, or sharing project layouts without revealing sensitive names.
my_projects/ my_projects/
โโโ ๆ็้กน็ฎ/ โโโ โโโ 9ce557b3/
โโโ test_data/ โโโ โโโ e7d87b73/
โโโ 2024ๅนดๆฅๅ/ โโโ โโโ 7c330497/
โโโ backend-api/ โโโ โโโ d753230e/
| Scenario | How fhash helps |
|---|---|
| ๐ Privacy | Obscure folder names before sharing or uploading |
| ๐ฆ Anonymization | Remove identifiable names from project structures |
| ๐งช Testing | Simulate opaque folder naming in CI/CD pipelines |
| ๐ฏ Organization | Temporarily hide project names while keeping structure intact |
| ๐ธ Screenshots | Hide sensitive folder names when taking screenshots |
- SHA-256 hashing โ 8-character hex hash per folder name (โ2.8 trillion combinations)
- Fully reversible โ Restore original names from the mapping file at any time
- Idempotent โ Running encode twice won't double-hash
- Collision-safe โ Auto-extends hash length (8โ9โ10...) on collision
- Dry-run preview โ See all changes before applying (
--dry-run) - Hidden folder aware โ Skips
.prefixed folders automatically - Unicode support โ Full CJK / emoji / Unicode folder name support
- Auto backup โ Creates
.bakbefore each operation - macOS Right-Click โ Native Finder Quick Actions (no third-party apps)
- GUI App โ Cross-platform tkinter GUI, buildable as macOS
.appand Windows.exe - Zero dependencies โ Pure Python stdlib (no
pip installneeded)
git clone https://github.com/zephyrq-z/fhash.git
cd fhash
# Install CLI to ~/bin/fhash
bash install.sh
# Install Finder right-click Quick Actions
bash install_quick_actions.shRequires Python 3.9+ โ no pip packages needed.
git clone https://github.com/zephyrq-z/fhash.git
cd fhash
bash install.sh
# Or run directly without installing:
python3 fhash.py --helpgit clone https://github.com/zephyrq-z/fhash.git
cd fhash
python3 fhash_gui.py| Platform | File | How to use |
|---|---|---|
| macOS | fhash.app |
Drag to /Applications, double-click to run |
| Windows | fhash.exe |
Double-click to run, no install needed |
Download from Releases (coming soon).
After running bash install_quick_actions.sh:
- Open Finder
- Select a folder
- Right-click โ Quick Actions โ
- fhash Encode โ Hash all subfolder names
- fhash Decode โ Restore original folder names
- A notification will appear when done
Tip: If Quick Actions don't appear, go to System Settings โ Privacy & Security โ Extensions โ Finder and enable fhash.
# Encode โ hash all subfolder names
fhash encode /path/to/folder
# Preview only (dry-run, no changes)
fhash encode /path/to/folder --dry-run
# Decode โ restore original names
fhash decode /path/to/folder
# List โ view current mapping (read-only)
fhash list /path/to/folder
# Current directory (no path needed)
cd /path/to/folder && fhash encode
# Use -n to specify path
fhash encode -n /path/to/folder
# Skip confirmation prompt
fhash encode /path/to/folder --yes$ fhash encode ~/projects --dry-run
Original Name โ Hashed Name
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโ โโโโโโโโโโโโ
2024ๅนดๆฅๅ โ 7c330497
backend-api โ d753230e
test_data โ e7d87b73
ๆ็้กน็ฎ โ 9ce557b3
4 folder(s) will be renamed.
[dry-run] No changes made.$ fhash decode ~/projects --yes
Hashed Name โ Original Name
โโโโโโโโโโโโ โโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
7c330497 โ 2024ๅนดๆฅๅ
d753230e โ backend-api
e7d87b73 โ test_data
9ce557b3 โ ๆ็้กน็ฎ
โ
Done. 4 folder(s) restored to original names.Launch the app and:
- Select a folder โ Click "Browseโฆ" or paste a path
- Preview โ Click "๐ Preview Encode" to see what will change
- Encode โ Click "๐ Encode" to hash folder names
- Decode โ Click "๐ Decode" to restore original names
- Refresh โ Click "๐ Refresh" to reload the folder list
Target Folder/
โโโ .folder_hash_map.json โ Hidden mapping file (JSON)
โโโ a3f1b2c7/ โ Was "ๆ็้กน็ฎ"
โโโ 8d4e2f01/ โ Was "test_data"
โโโ e7c93a12/ โ Was "2024ๅนดๆฅๅ"
Mapping file (.folder_hash_map.json):
{
"_meta": {
"created": "2026-06-14T02:42:19.845934+00:00",
"hash_algo": "sha256_8char"
},
"a3f1b2c7": "ๆ็้กน็ฎ",
"8d4e2f01": "test_data",
"e7c93a12": "2024ๅนดๆฅๅ"
}Algorithm:
- Compute
SHA-256(folder_name)and take the first 8 hex characters - If a collision occurs, auto-extend to 9, 10, ... up to 64 characters
- Rename each subfolder to its hash value
- Store the
hash โ original_namemapping in.folder_hash_map.json - Hidden folders (
.prefix) are always skipped - A
.bakbackup of the mapping file is created before each operation
git clone https://github.com/zephyrq-z/fhash.git
cd fhash
pip3 install pyinstaller pillow
bash build_mac.sh
# Output: dist/fhash.appOn a Windows machine with Python 3.9+:
git clone https://github.com/zephyrq-z/fhash.git
cd fhash
pip install pyinstaller pillow
build_win.bat
# Output: dist\fhash.exepip install pillow
python3 assets/gen_icon.py
# Generates assets/icon.icns (macOS) and assets/icon.ico (Windows)fhash/
โโโ fhash.py # CLI tool (core logic)
โโโ fhash_gui.py # GUI application (tkinter, cross-platform)
โโโ fhash-encode-runner.sh # macOS Quick Action runner (encode)
โโโ fhash-decode-runner.sh # macOS Quick Action runner (decode)
โโโ install.sh # CLI installer (symlink to ~/bin)
โโโ install_quick_actions.sh # macOS Finder Quick Actions installer
โโโ build_mac.sh # macOS .app builder (PyInstaller)
โโโ build_win.bat # Windows .exe builder (PyInstaller)
โโโ assets/
โ โโโ gen_icon.py # App icon generator (Pillow)
โ โโโ icon.icns # macOS icon
โ โโโ icon.ico # Windows icon
โโโ README.md # English docs (this file)
โโโ README.zh-CN.md # ไธญๆๆๆกฃ
โโโ LICENSE # MIT License
โโโ .gitignore
Is this real encryption?
No, it's hashing with a mapping file. The SHA-256 hash itself is one-way (irreversible), but the
.folder_hash_map.json stores the original names for restoration. Anyone with access to the mapping file can see the original names. If you need true encryption, consider adding a password-protected mapping file (see Contributing ideas).
What happens if I delete the mapping file?
The hashed folder names will remain, but you won't be able to restore them automatically. Always keep a backup of
.folder_hash_map.json. Fortunately, a .bak backup is created before each operation.
Can I hash nested (deep) folders?
No, fhash only processes immediate subfolders (one level deep). This is by design for safety and simplicity. Use fhash on each directory separately if you need deeper hashing.
Will file contents be affected?
No. Only folder names are changed. All files, nested directories, and contents remain completely untouched.
What if two folder names produce the same hash?
The hash length auto-extends (8 โ 9 โ 10 chars) until all collisions are resolved. This is extremely rare with 8-char hashes (2.8 trillion combinations).
Why is the Quick Action not showing in Finder?
Go to System Settings โ Privacy & Security โ Extensions โ Finder and enable fhash Encode / fhash Decode. You may also need to restart Finder (
killall Finder) after installation.
Does it work with symlinks?
Symlinks to directories are not followed โ only real directories are processed. This prevents unintended renames across your filesystem.
Can I use it on Windows / Linux?
Yes! The CLI and GUI work on any platform with Python 3.9+. The Finder Quick Actions are macOS-only, but the CLI and GUI are fully cross-platform.
Issues and PRs are welcome! Here are some ideas for contributors:
- GUI drag-and-drop folder support
- Linux .AppImage / Nautilus right-click integration
- Windows Explorer right-click context menu (registry)
- Regex-based folder name filtering
- Password-encrypted mapping file option
- Batch mode for multiple directories
- Undo history (multi-level rollback)
- i18n: add more languages
MIT License โ free for personal and commercial use.
Made with โค๏ธ by zephyrq-z