Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

Object.GetHashCode

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Declaration

public int GetHashCode();

Returns

int The hash code for the object.

Description

Returns the hash code for the object.

The hash code is stable for the object and doesn't change if you modify the object's fields, so you can safely use an object as a key in a hash-based collection such as a Dictionary or HashSet. The hash code is consistent with Object.Equals: two references that are equal return the same hash code.