Git seems to use the two most significant hex digits of a content hash as a directory name for content-addressable objects. The same two digits are left out of normal file names. I'm assuming the intent is to limit the size of directory listings, while maintaining a relationship between names and content.

├── 01
│   └── db1550e888941883a96b63394f0fe65e892635
├── 02
│   └── 98cc41b182fca79597e9c3fa3fa033eb2673f1
├── 03
│   ├── aa0112ac4942a3f9c64cb6358a7319273e7a33
│   ├── af3aeb71ea5f86af5296f0825c15677c5923ad
│   └── ccc7640a6a7479b2cf566ba14ff4dc7fe773a9
├── 04
│   └── 5e0398efb428a5cfbaa9b65eaca82201638146

Does this pattern for content-addressable storage have a name independent of the hash function used?


1 Answer 1


This is a trie that is truncated to two levels.

  • $\begingroup$ Thank you for this. $\endgroup$ Jan 5, 2022 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.