Struct Hash128
A 128 bit hash, for cases where 32 or 64 bits are insufficient. Built on top of Unity.Mathematics types that will Burst-compile to SIMD instructions, for efficiency comparable to a 32-bit hash.
Namespace: Unity.Entities
Assembly: Unity.Entities.dll
Syntax
[Serializable]
public struct Hash128
Constructors
Name | Description |
---|---|
Hash128(string) | Construct a hash from a 32 character hex string |
Hash128(string, bool) | Construct a hash from a 32 character hex string If the string has the incorrect length or non-hex characters the Value will be all 0 |
Hash128(uint, uint, uint, uint) | Construct a hash from four 32-bit input values. |
Hash128(uint4) | Construct a hash from a 128-bit input value. |
Fields
Name | Description |
---|---|
Value | The 128-bit hash value, as four consecutive 32-bit unsigned integers. |
Properties
Name | Description |
---|---|
IsValid | A Hash128 is valid, only if at least one of its 128 bits has value 1. |
Methods
Name | Description |
---|---|
CompareTo(Hash128) | Compares this hash's value to another hash's, and returns an integer that is negative if this hash's value is less, 0 if the same, or positive if more than the other hash. |
Equals(object) | Determines whether some object is equal to this hash. |
Equals(Hash128) | Determines whether a hash is equal to this hash. |
GetHashCode() | Computes a hashcode to support hash-based collections. |
ToString() | Convert a Hash128 to a 32-character UTF-16 string of hexadecimal symbols. |
Operators
Name | Description |
---|---|
operator ==(Hash128, Hash128) | Compares two hashes for equality. |
operator >(Hash128, Hash128) | Determines whether one hash's value is greater than another hash's value |
implicit operator GUID(Hash128) | Implicitly convert a Hash128 to a UnityEditor.GUID. |
implicit operator Hash128(Hash128) | Implicitly convert a Hash128 to a UnityEngine.Hash128. |
implicit operator Hash128(GUID) | Implicitly convert a UnityEditor.GUID to a Hash128. |
implicit operator Hash128(Hash128) | Implicitly convert a UnityEngine.Hash128 to a Hash128. |
operator !=(Hash128, Hash128) | Compares two hashes for inequality. |
operator <(Hash128, Hash128) | Determines whether one hash's value is less than another hash's value |