https://github.com/travisbrown/prefix-file-tree
https://github.com/travisbrown/prefix-file-tree
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/travisbrown/prefix-file-tree
- Owner: travisbrown
- License: gpl-3.0
- Created: 2025-11-09T18:23:50.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-11-09T20:50:28.000Z (9 months ago)
- Last Synced: 2025-11-09T22:20:33.375Z (9 months ago)
- Language: Rust
- Size: 22.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# prefix-file-tree
[](https://github.com/travisbrown/prefix-file-tree/actions)
[](https://codecov.io/github/travisbrown/prefix-file-tree)
A small Rust library that provides a way to store many files in a predictable nested directory structure
(see ["Pairtrees for Object Storage"][pairtree] for an explanation of the motivation and general idea).
For example, suppose you want to store a set of files by taking the SHA-1 hash of their contents and using
the Base32 encoding as file names. If you have many millions of files to store, it may be impractical to
keep them in a single directory.
This library gives you an easy way to rewrite a file name like `MFRGGZC7MFRGGZC7MFRGGZC7MVTGO2C7`
as `MFR/GG/MFRGGZC7MFRGGZC7MFRGGZC7MVTGO2C7`, and to iterate over the contents of a directory structure like
this in order (even when the hash order doesn't match the ASCII order, as in the case of Base32).
[pairtree]: https://datatracker.ietf.org/doc/html/draft-kunze-pairtree-01