Sisk

Method

HashCodeHelper.DeterministicHash

Namespace
Sisk.Core.Helpers
Assembly
Sisk.Core.dll

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.

C#
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 #

ulong

A 64‑bit hash value representing the input characters.

DeterministicHash(ReadOnlySpan<char>) #

Computes a deterministic 64‑bit hash for the supplied ReadOnlySpan of characters.

C#
public static ulong DeterministicHash(ReadOnlySpan<char> s)

Parameters #

s ReadOnlySpan<char>

The span of characters to hash.

Returns #

ulong

A 64‑bit hash value representing the input characters.

DeterministicHash(string?) #

Computes a deterministic 64‑bit hash for the supplied String.

C#
public static ulong DeterministicHash(string? s)

Parameters #

s string?

The string to hash. May be null or empty.

Returns #

ulong

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.

C#
public static ulong DeterministicHash(object? data)

Parameters #

data object?

The object to hash. May be null.

Returns #

ulong

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.

Type to search the documentation and the API reference.