Hacker News new | ask | show | jobs
by fch42 63 days ago
xor'ing the elements of lists together also allows a test of "unordered equality" because 1^2^3^4^5 == (xor of any permutation of [1,2,3,4,5]).

Yes there are false positives, and the false negative of all-zero/all-equal, but the test can be useful in a "bloom filter" type case.

Have used it in dynamic firewalling rules ... one can do something pretty close to a JA3/JA4 TLS fingerprint in eBPF with that (to match the cipher lists).

1 comments

You could also do your weak equality test by taking the sum 1+2+3+4+5, or the product 12345, or any other commutative binary operator.