       after  (drop-while #(pos? (compare after (str %))))
       prefix (take-while #(.startsWith (str %) prefix))
       limit  (take limit))))
+
+
+(defn scan-size
+  "Scans the blobs in a store to determine the total stored content size."
+  [store]
+  (reduce + 0 (map (comp :stat/size (partial stat store)) (list store))))



(defn list
  "Enumerates the stored blobs, returning a sequence of HashIDs.
  See `select-ids` for the available query options."
  ([store]
   (enumerate store nil))

(defn store!
  "Stores content from a byte source in a blob store and returns the blob
  record. This method accepts any source which can be handled as a byte
  stream by the byte-streams library."
  [store source]
  (when-let [blob (content/read source)]
    (put! store blob)))



;; ## Utility Functions

(defn select-ids
  "Selects hash identifiers from a sequence based on input criteria.
  Available options:

  - `:after`   start enumerating ids lexically following this string
  - `:prefix`  only return ids starting with the given string
  - `:limit`   limit the number of results returned"
  [opts ids]
  (let [{:keys [after prefix limit]} opts
        after (or after prefix)]
