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
Syntax
[Serializable]
public struct Hash128 : IEquatable<Hash128>, IComparable<Hash128>
Constructors
Name | Description |
---|---|
Hash128(String) | Construct a hash from a 32 character hex string |
Hash128(String, Boolean) | 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(UInt32, UInt32, UInt32, UInt32) | 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 |
---|---|
Equality(Hash128, Hash128) | Compares two hashes for equality. |
GreaterThan(Hash128, Hash128) | Determines whether one hash's value is greater than another hash's value |
Implicit(Hash128 to GUID) | Implicitly convert a Hash128 to a UnityEditor.GUID. |
Implicit(Hash128 to Hash128) | Implicitly convert a Hash128 to a UnityEngine.Hash128. |
Implicit(GUID to Hash128) | Implicitly convert a UnityEditor.GUID to a Hash128. |
Implicit(Hash128 to Hash128) | Implicitly convert a UnityEngine.Hash128 to a Hash128. |
Inequality(Hash128, Hash128) | Compares two hashes for inequality. |
LessThan(Hash128, Hash128) | Determines whether one hash's value is less than another hash's value |