Adopted scaling of did hashes based on the number of metadata entries
Instead of truncating to exactly 28-bits for nice leb128 alignment, we now truncate to ~the number of metadata entries, which must be >= ~2x the number dids since each did needs a dir entry and dstart entry. This has the downside of needing to actually keep track of an estimate of the number of metadata entries, which is made a bit difficult due to integer overflow issues (we can have more than 2^32 metadata entries), but has the upside of allowing a full 2^32 number of dids worst case. This is really unlikely, but it's nice to not need another configuration option to control the did limit. Another option would be to scale the hashes based on the number dids, which would be a more direct solution. Unfortunately determining the number of dids during mount requires a O(m*log(m)) scan of each rbyd to find either dir entries or dstart entries. This solution can easily end up with an overestimate, but only needs to weight of each rbyd which can be (and already is) found in O(m).
This commit is contained in: