Table of Contents

Method CombineHashCodes

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

CombineHashCodes(int, int)

Combines two integer hash codes into a single value using high-entropy bit mixing.

public static int CombineHashCodes(int newKey, int currentKey)

Parameters

newKey int

The new hash code to incorporate.

currentKey int

The current accumulated hash code.

Returns

int

A 32-bit integer representing the combined hash value.

Remarks

This method multiplies currentKey by 0xA5555529, a high-dispersion constant, and adds newKey to it. The result achieves better distribution across bit space than simpler prime-based mixing strategies, and mirrors techniques used in internal .NET hashing.