DotNext by .NET Foundation and Contributors

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

 FNV1a<THash, TParameters>

public class FNV1a<THash, TParameters> : NonCryptographicHashAlgorithm, IResettable where THash : ValueType modreq(System.Runtime.InteropServices.UnmanagedType), IBinaryNumber<THash> where TParameters : IFNV1aParameters<THash>
Represents FNV-1a hash algorithm.
public FNV1a(bool salted = false)

Represents FNV-1a hash algorithm.

public static THash Hash<T>(ReadOnlySpan<T> data, bool salted = false) where T : ValueType modreq(System.Runtime.InteropServices.UnmanagedType)

Computes hash code over the span of elements.

public static THash Hash<T, TIndex>(Func<T, TIndex, THash> accessor, TIndex count, T arg, bool salted = false) where TIndex : IComparisonOperators<TIndex, TIndex, bool>, IAdditiveIdentity<TIndex, TIndex>, IIncrementOperators<TIndex>

Computes hash code over elements returned by vector accessor.

public static THash Hash(Void* address, UIntPtr length, bool salted = false)

Computes hash code for the specified block of unmanaged memory.

public static THash Hash(THash data)

Computes a hash for a value of type THash.

Appends the contents of source to the data already processed for the current hash computation.

public void Append(Void* address, UIntPtr length)

Appends the contents of unmanaged memory to the data already processed for the current hash computation.

public void Append(THash value)

Appends the value to the data already processed for the current hash computation.

public THash GetCurrentHash()

Gets the current computed hash value without modifying accumulated state.