Skip to content

TextStudioDeterministicHash

ClassTextStudioTextStudio
public static class TextStudioDeterministicHash

Stateless deterministic hashing for stable local variation without touching Unity random state.

public static uint Hash(int identity, int salt)

Returns a deterministic unsigned hash for one integer identity and salt.

Parameters

Name Type
identity System.Int32
salt System.Int32

Returns

System.UInt32

public static float Value01(int identity, int salt)

Returns a deterministic normalized value in the inclusive range from zero to one.

Parameters

Name Type
identity System.Int32
salt System.Int32

Returns

System.Single

public static float SignedValue(int identity, int salt)

Returns a deterministic normalized value in the inclusive range from minus one to one.

Parameters

Name Type
identity System.Int32
salt System.Int32

Returns

System.Single