docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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


    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    Thanks for letting us know! This page has been marked for review based on your feedback.

    If you have time, you can provide more information to help us fix the problem faster.

    Provide more information

    You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:

    You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:

    You've told us there is information missing from this page. Please tell us more about what's missing:

    You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

    You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

    You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:

    You've told us this page has a problem. Please tell us more about what's wrong:

    Thank you for helping to make the Unity documentation better!

    Your feedback has been submitted as a ticket for our documentation team to review.

    We are not able to reply to every ticket submitted.

    In This Article
    • Constructors
    • Fields
    • Properties
    • Methods
    • Operators
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)