HashCode.Combine Method

Definition

Overloads

Combine<T1,T2,T3,T4,T5,T6,T7,T8>(T1, T2, T3, T4, T5, T6, T7, T8)

Combines eight values into a hash code.

Combine<T1,T2,T3,T4,T5,T6,T7>(T1, T2, T3, T4, T5, T6, T7)

Combines seven values into a hash code.

Combine<T1,T2,T3,T4,T5,T6>(T1, T2, T3, T4, T5, T6)

Combines six values into a hash code.

Combine<T1,T2,T3,T4,T5>(T1, T2, T3, T4, T5)

Combines five values into a hash code.

Combine<T1,T2,T3,T4>(T1, T2, T3, T4)

Combines four values into a hash code.

Combine<T1,T2,T3>(T1, T2, T3)

Combines three values into a hash code.

Combine<T1,T2>(T1, T2)

Combines two values into a hash code.

Combine<T1>(T1)

Diffuses the hash code returned by the specified value.

Combine<T1,T2,T3,T4,T5,T6,T7,T8>(T1, T2, T3, T4, T5, T6, T7, T8)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines eight values into a hash code.

public static int Combine<T1,T2,T3,T4,T5,T6,T7,T8> (T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8);

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

T4

The type of the fourth value to combine into the hash code.

T5

The type of the fifth value to combine into the hash code.

T6

The type of the sixth value to combine into the hash code.

T7

The type of the seventh value to combine into the hash code.

T8

The type of the eighth value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

value4
T4

The fourth value to combine into the hash code.

value5
T5

The fifth value to combine into the hash code.

value6
T6

The sixth value to combine into the hash code.

value7
T7

The seventh value to combine into the hash code.

value8
T8

The eighth value to combine into the hash code.

Returns

The hash code that represents the eight values.

Applies to

.NET 9 및 기타 버전
제품 버전
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.0 (package-provided), 2.1

Combine<T1,T2,T3,T4,T5,T6,T7>(T1, T2, T3, T4, T5, T6, T7)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines seven values into a hash code.

public static int Combine<T1,T2,T3,T4,T5,T6,T7> (T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7);

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

T4

The type of the fourth value to combine into the hash code.

T5

The type of the fifth value to combine into the hash code.

T6

The type of the sixth value to combine into the hash code.

T7

The type of the seventh value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

value4
T4

The fourth value to combine into the hash code.

value5
T5

The fifth value to combine into the hash code.

value6
T6

The sixth value to combine into the hash code.

value7
T7

The seventh value to combine into the hash code.

Returns

The hash code that represents the seven values.

Applies to

.NET 9 및 기타 버전
제품 버전
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.0 (package-provided), 2.1

Combine<T1,T2,T3,T4,T5,T6>(T1, T2, T3, T4, T5, T6)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines six values into a hash code.

public static int Combine<T1,T2,T3,T4,T5,T6> (T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6);

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

T4

The type of the fourth value to combine into the hash code.

T5

The type of the fifth value to combine into the hash code.

T6

The type of the sixth value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

value4
T4

The fourth value to combine into the hash code.

value5
T5

The fifth value to combine into the hash code.

value6
T6

The sixth value to combine into the hash code.

Returns

The hash code that represents the six values.

Applies to

.NET 9 및 기타 버전
제품 버전
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.0 (package-provided), 2.1

Combine<T1,T2,T3,T4,T5>(T1, T2, T3, T4, T5)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines five values into a hash code.

public static int Combine<T1,T2,T3,T4,T5> (T1 value1, T2 value2, T3 value3, T4 value4, T5 value5);

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

T4

The type of the fourth value to combine into the hash code.

T5

The type of the fifth value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

value4
T4

The fourth value to combine into the hash code.

value5
T5

The fifth value to combine into the hash code.

Returns

The hash code that represents the five values.

Applies to

.NET 9 및 기타 버전
제품 버전
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.0 (package-provided), 2.1

Combine<T1,T2,T3,T4>(T1, T2, T3, T4)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines four values into a hash code.

public static int Combine<T1,T2,T3,T4> (T1 value1, T2 value2, T3 value3, T4 value4);

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

T4

The type of the fourth value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

value4
T4

The fourth value to combine into the hash code.

Returns

The hash code that represents the four values.

Applies to

.NET 9 및 기타 버전
제품 버전
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.0 (package-provided), 2.1

Combine<T1,T2,T3>(T1, T2, T3)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines three values into a hash code.

public static int Combine<T1,T2,T3> (T1 value1, T2 value2, T3 value3);

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

Returns

The hash code that represents the three values.

Applies to

.NET 9 및 기타 버전
제품 버전
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.0 (package-provided), 2.1

Combine<T1,T2>(T1, T2)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines two values into a hash code.

public static int Combine<T1,T2> (T1 value1, T2 value2);

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

Returns

The hash code that represents the two values.

Applies to

.NET 9 및 기타 버전
제품 버전
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.0 (package-provided), 2.1

Combine<T1>(T1)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Diffuses the hash code returned by the specified value.

public static int Combine<T1> (T1 value1);

Type Parameters

T1

The type of the value to add the hash code.

Parameters

value1
T1

The value to add to the hash code.

Returns

The hash code that represents the single value.

Remarks

Some data structures assume that hash codes are diffused across a large range. This method improves the quality of the hash code returned by the value and is useful when the underlying data type is simple, for example, an integer value.

Applies to

.NET 9 및 기타 버전
제품 버전
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.0 (package-provided), 2.1