HASH_COMBINE_COMMUTATIVE
Description
Performs commutative hash combination on multiple values. Unlike the regular hash_combine, the result of hash_combine_commutative is not affected by the order of parameters, meaning hash_combine_commutative(a, b, c) yields the same result as hash_combine_commutative(c, b, a). This function is commonly used in scenarios requiring hash computation for unordered sets.
Parameters
value1,value2, ...: any type, the values to combine hashes for. At least one parameter is required.
Return Result
biginttype- Returns the commutative hash combination result of all input values
- The result is independent of parameter order
Examples
Notes
hash_combine_commutativeis commutative, meaning parameter order does not affect the result- Difference from
hash_combine:hash_combineconsiders parameter order, whilehash_combine_commutativedoes not - Commonly used for computing hash values of unordered data structures (such as
set,bitmap,map) - This function works together with
general_murmurhash3to implement hash computation for complex data structures - Suitable for scenarios requiring deduplication or comparison of sets, where the order of elements is typically not important
