Table of Contents

Class StableHash

Namespace
The.Caching
Assembly
Instagile.dll

Utility methods for persisted cache keys.

public static class StableHash
Inheritance
StableHash
Inherited Members

Methods

ForString(string)

Produces a stable hash code using the Marvin32 algorithm (which GetHashCode() does not).

public static int ForString(string str)

Parameters

str string

Returns

int

Remarks

This implementation is based on .NET's Marvin hashing algorithm but uses a fixed seed (0, 0) to ensure stability. .NET's string.GetHashCode() uses a randomized seed to prevent hash-based attacks, but we need stable hashes for caching.