Class Hashing
Inheritance
System.Object
Hashing
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GameKit.Dependencies.Utilities
Assembly: GameKit.Dependencies.dll
Syntax
public static class Hashing
Methods
GetStableHashU16(String)
non cryptographic stable hash code,
it will always return the same hash for the same
string.
This is simply an implementation of FNV-1 32 bit xor folded to 16 bit https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
Declaration
public static ushort GetStableHashU16(this string txt)
Parameters
Type | Name | Description |
---|---|---|
System.String | txt | Text. |
Returns
Type | Description |
---|---|
System.UInt16 | The stable hash32. |
GetStableHashU32(String)
non cryptographic stable hash code,
it will always return the same hash for the same
string.
This is simply an implementation of FNV-1 32 bit https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
Declaration
public static uint GetStableHashU32(this string txt)
Parameters
Type | Name | Description |
---|---|---|
System.String | txt | Text. |
Returns
Type | Description |
---|---|
System.UInt32 | The stable hash32. |
GetStableHashU64(String)
non cryptographic stable hash code,
it will always return the same hash for the same
string.
This is simply an implementation of FNV-1 64 bit https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
Declaration
public static ulong GetStableHashU64(this string txt)
Parameters
Type | Name | Description |
---|---|---|
System.String | txt | Text. |
Returns
Type | Description |
---|---|
System.UInt64 | The stable hash32. |