Method
HashCodeHelper.DeterministicHash
DeterministicHash(ReadOnlySpan<char>, ulong, ulong, int) #
Computes a deterministic 64‑bit hash for the supplied ReadOnlySpan of characters using the specified seed, prime, and step values.
public static ulong DeterministicHash(ReadOnlySpan<char> s, ulong eseed, ulong eprime, int step)Parameters #
s ReadOnlySpan<char>
The span of characters to hash.
eseed ulong
The initial seed value for the hash algorithm.
eprime ulong
The prime multiplier used in the hash algorithm.
step int
The step increment for iterating over the span.
Returns #
A 64‑bit hash value representing the input characters.
DeterministicHash(ReadOnlySpan<char>) #
Computes a deterministic 64‑bit hash for the supplied ReadOnlySpan of characters.
public static ulong DeterministicHash(ReadOnlySpan<char> s)Parameters #
s ReadOnlySpan<char>
The span of characters to hash.
Returns #
A 64‑bit hash value representing the input characters.
DeterministicHash(string?) #
Computes a deterministic 64‑bit hash for the supplied String.
public static ulong DeterministicHash(string? s)Parameters #
s string?
The string to hash. May be null or empty.
Returns #
The hash of the string, or 0 if s is null or empty.
DeterministicHash(object?) #
Computes a deterministic 64‑bit hash for an arbitrary Object.
public static ulong DeterministicHash(object? data)Parameters #
data object?
The object to hash. May be null.
Returns #
If data is null, returns 0;
if it is a String, returns the hash of that string;
otherwise returns the 64‑bit representation of GetHashCode.