mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 11:58:28 +00:00
9f92f8c609
If the GC finds a key k that it wants to keep, it records that in a Bloom filter. If a key k' can be removed but its hash collides with k, it will be kept. Since the old Bloom filter code was completely deterministic, the next run would encounter the same collision, assuming k must still be kept. A randomized hash function that uses all the SHA-256 bits solves this problem: the second run has a non-zero probability of removing k', as long as the Bloom filter is not completely full.