DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="4.7.4" />

.NET API 552,344 bytes

 BitwiseComparer<T>

public sealed class BitwiseComparer<T> : IEqualityComparer<T>, IComparer<T> where T : struct
Represents bitwise comparer for the arbitrary value type.
public static BitwiseComparer<T> Instance { get; }

Gets instance of this comparer.

public static int Compare<TOther>(ref T first, ref TOther second) where TOther : struct

Compares bits of two values of the different type.

public static bool Equals<TOther>(ref T first, ref TOther second) where TOther : struct

Checks bitwise equality between two values of different value types.

public static int GetHashCode(ref T value, bool salted = true)

Computes hash code for the structure content.

public static int GetHashCode(ref T value, int hash, Func<int, int, int> hashFunction, bool salted = true)

Computes bitwise hash code for the specified value.

public static int GetHashCode<THashFunction>(ref T value, bool salted = true) where THashFunction : struct, IConsumer<int>, ISupplier<int>

Computes bitwise hash code for the specified value.