▲ | hundredwatt a day ago | |
A neat trick to make the accumulator both collision-resistant and self-diagnosing.
If acc is zero, all links are reciprocal (same guarantee as before).If acc is non-zero, split it back into (x', h'): * Re-compute h(x'). * If it equals h', exactly one link is unpaired and x' tells you which one (or an astronomically unlikely collision). Otherwise there are >= 2 problems. This has collision-resistance like the parent comment and adds the ability to pinpoint a single offending link without a second pass or a hash table. |