Table of Contents

Class StringToken

Namespace
ValveResourceFormat.Utils
Assembly
ValveResourceFormat.dll

Provides utilities for string token hashing and inverse lookup.

public static class StringToken

Inheritance

Inherited Members

Fields

InvertedTable

Gets the inverted table for hash to string lookups.

public static readonly ConcurrentDictionary<uint, string> InvertedTable

Field Value

ConcurrentDictionary<uint, string>

MURMUR2SEED

MurmurHash2 seed value.

public const uint MURMUR2SEED = 826366246

Field Value

uint

VRF_GENERATOR

Generator identification string with version.

public static readonly string VRF_GENERATOR

Field Value

string

Methods

Get(string)

Computes the hash token for the given string.

public static uint Get(string key)

Parameters

key string

The string to hash.

Returns

uint

The hash token.

GetKnownString(uint)

Gets a known string for the given hash, or returns an unknown key placeholder.

public static string GetKnownString(uint hash)

Parameters

hash uint

The hash to look up.

Returns

string

The known string or a placeholder.

Store(string)

Store a string to the table of known string hashes, so it can later be retrieved using ValveResourceFormat.Utils.StringToken.GetKnownString(System.UInt32).

public static uint Store(string key)

Parameters

key string

Returns

uint

Store(IEnumerable<string>)

Store a number of strings to the table of known string hashes, so they can later be retrieved using ValveResourceFormat.Utils.StringToken.GetKnownString(System.UInt32).

public static void Store(IEnumerable<string> keys)

Parameters

keys IEnumerable<string>