Table of Contents

Struct XxHash32

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Incremental hash builder implementing xxHash32, used internally to compute expression and query plan hashes.

public struct XxHash32
Inherited Members
Extension Methods

Remarks

Named after the algorithm so it does not collide with HashCode. Algorithm reference: https://github.com/Cyan4973/xxHash

Methods

Add(int)

Adds a 32-bit integer to the running hash code.

public void Add(int value)

Parameters

value int

The value to add.

AddBytes(ReadOnlySpan<byte>)

Adds a span of bytes to the hash code.

public void AddBytes(ReadOnlySpan<byte> value)

Parameters

value ReadOnlySpan<byte>

The span.

Remarks

This method does not guarantee that the result of adding a span of bytes will match the result of adding the same bytes individually.

Add<T>(T?)

Adds a value to the running hash code.

public void Add<T>(T? value)

Parameters

value T

The value to add; a null reference contributes zero.

Type Parameters

T

The type of the value.

Add<T>(T?, IEqualityComparer<T?>?)

Adds a value to the running hash code, computing its hash with the supplied comparer.

public void Add<T>(T? value, IEqualityComparer<T?>? comparer)

Parameters

value T

The value to add; a null reference contributes zero.

comparer IEqualityComparer<T>

The comparer used to hash value, or null to use the value's own hash code.

Type Parameters

T

The type of the value.

Combine<T1>(T1)

Combines the hash code of a single value into a 32-bit hash code.

public static int Combine<T1>(T1 value1)

Parameters

value1 T1

The value to include in the hash.

Returns

int

The combined hash code.

Type Parameters

T1

The type of the value.

Combine<T1, T2>(T1, T2)

Combines the hash codes of two values into a single 32-bit hash code.

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

Parameters

value1 T1

The first value to include in the hash.

value2 T2

The second value to include in the hash.

Returns

int

The combined hash code.

Type Parameters

T1

The type of the first value.

T2

The type of the second value.

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

Combines the hash codes of three values into a single 32-bit hash code.

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

Parameters

value1 T1

The first value to include in the hash.

value2 T2

The second value to include in the hash.

value3 T3

The third value to include in the hash.

Returns

int

The combined hash code.

Type Parameters

T1

The type of the first value.

T2

The type of the second value.

T3

The type of the third value.

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

Combines the hash codes of four values into a single 32-bit hash code.

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

Parameters

value1 T1

The first value to include in the hash.

value2 T2

The second value to include in the hash.

value3 T3

The third value to include in the hash.

value4 T4

The fourth value to include in the hash.

Returns

int

The combined hash code.

Type Parameters

T1

The type of the first value.

T2

The type of the second value.

T3

The type of the third value.

T4

The type of the fourth value.

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

Combines the hash codes of five values into a single 32-bit hash code.

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

Parameters

value1 T1

The first value to include in the hash.

value2 T2

The second value to include in the hash.

value3 T3

The third value to include in the hash.

value4 T4

The fourth value to include in the hash.

value5 T5

The fifth value to include in the hash.

Returns

int

The combined hash code.

Type Parameters

T1

The type of the first value.

T2

The type of the second value.

T3

The type of the third value.

T4

The type of the fourth value.

T5

The type of the fifth value.

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

Combines the hash codes of six values into a single 32-bit hash code.

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

Parameters

value1 T1

The first value to include in the hash.

value2 T2

The second value to include in the hash.

value3 T3

The third value to include in the hash.

value4 T4

The fourth value to include in the hash.

value5 T5

The fifth value to include in the hash.

value6 T6

The sixth value to include in the hash.

Returns

int

The combined hash code.

Type Parameters

T1

The type of the first value.

T2

The type of the second value.

T3

The type of the third value.

T4

The type of the fourth value.

T5

The type of the fifth value.

T6

The type of the sixth value.

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

Combines the hash codes of seven values into a single 32-bit 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)

Parameters

value1 T1

The first value to include in the hash.

value2 T2

The second value to include in the hash.

value3 T3

The third value to include in the hash.

value4 T4

The fourth value to include in the hash.

value5 T5

The fifth value to include in the hash.

value6 T6

The sixth value to include in the hash.

value7 T7

The seventh value to include in the hash.

Returns

int

The combined hash code.

Type Parameters

T1

The type of the first value.

T2

The type of the second value.

T3

The type of the third value.

T4

The type of the fourth value.

T5

The type of the fifth value.

T6

The type of the sixth value.

T7

The type of the seventh value.

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

Combines the hash codes of eight values into a single 32-bit 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)

Parameters

value1 T1

The first value to include in the hash.

value2 T2

The second value to include in the hash.

value3 T3

The third value to include in the hash.

value4 T4

The fourth value to include in the hash.

value5 T5

The fifth value to include in the hash.

value6 T6

The sixth value to include in the hash.

value7 T7

The seventh value to include in the hash.

value8 T8

The eighth value to include in the hash.

Returns

int

The combined hash code.

Type Parameters

T1

The type of the first value.

T2

The type of the second value.

T3

The type of the third value.

T4

The type of the fourth value.

T5

The type of the fifth value.

T6

The type of the sixth value.

T7

The type of the seventh value.

T8

The type of the eighth value.

ToHashCode()

Computes the final 32-bit hash code from the values added so far.

public int ToHashCode()

Returns

int

The xxHash32 hash code.