As described:
<https://jausoft.com/cgit/cgit.git/commit/?id=4d8f593faf93b1043309e987823220a70f70a701>

Or find it in <https://jausoft.com/cgit/cgit.git/log/>,
if I must revise it (bugs).

Will post the patch if interested.

I get good collision-free hashes w/ 
e.g. 16M cache-size (16777215), see table below
with added used hex-nibbles.

Maximum would be full 64-bit values,
however .. this is surely not desired :)
(On a ZFS fs this would not be an issue though)

The FNV-1a 64bit hash is the clipped
to the desired size w/ shift-xor and masking.

The project hash is also better concatenated,
passing the previous round to the hash-algo.

When updating or changing the cache-size,
one better temporarily removes the binary
and re-creates the cache/cgit folder.
See 
<https://jausoft.com/cgit/cgit.git/tree/scripts/clean-cgit-cache.sh?h=jau_config&id=7a24e791c9273bdd57b492c0272663e39596b37e>

Comments and ideas are welcome.

Cheers,

~Sven

# FFFFFFFF 4294M (full 32-bit)
# cache-size=4294967295
#  FFFFFFF  268M
# cache-size=268435455
#   FFFFFF   16M
cache-size=16777215
#    FFFFF    1M
# cache-size=1048575


Reply via email to