   (let [hex (multihash/hex id)]
     (io/file
       root
-      (subs hex 0 4)
-      (subs hex 4 6)
-      (subs hex 6 8)
-      (subs hex 8))))
+      (subs hex 0 dir-prefix-length)
+      (subs hex dir-prefix-length))))
 
 
 (defn- file->id


;; ## File Block Functions

(defn- file-stats
  "Calculates storage stats for a block file."
  [^File file]

  "Block storage backed by files in nested directories. Each block is stored in
  a separate file.

  In many filesystems, performance degrades as the number of files in a
  directory grows. In order to reduce this impact and make navigating the
  blocks a bit more efficient, block files are stored in directories under the
  store root. All path elements are lower-case hex-encoded bytes from the
  multihash.

  The directories under the root consist of the first four bytes of the
  multihashes of the blocks stored in them. Within each directory, blocks are
  stored in files whose names consist of the rest of their digests.

  Thus, a block containing the content `foobar` would have the sha1 digest
  `97df3501149...` and be stored under the root directory at:

  `root/111497df/35011497df3588b5a3...`

  This implementation tries to match the IPFS fs-repo behavior so that the
  on-disk representations remain compatible."
  (:require
    (blocks
      [core :as block]
