GetHashCode
virtual func GetHashCode() -> int
Declaring type: Object
Module: System
Assembly: System.Runtime.dll
Source file: Object.rvn
Returns a stable identity hash by default; an ordinary class may override it consistently with equality.
Return value
A signed 32-bit hash for the live object, or the hash supplied by a class override.
Remarks
The default class/array hash survives mutation and garbage collection and is shared by aliases. Collisions are allowed. It is not a unique object identifier, persisted value, native address or cross-execution contract. A null receiver raises NullReference. Virtual calls on boxed Int32 return its integer value as the hash. Boxed Int64 returns the XOR of its lower and upper 32-bit halves; equality compares the full 64-bit value. Boxed Boolean returns 1 for true and 0 for false. Char hashes its exact UTF-8 grapheme text; this is not the .NET UTF-16 code-unit hash. Single and Double normalize both signed zeros to zero and all NaN payloads to the positive-infinity bit pattern for hashing, matching .NET 10. Single uses the 32-bit pattern; Double XORs its two 32-bit halves. Colliding NaN and infinity hashes do not imply equality. Boxed named structs dispatch explicit GetHashCode overrides, including generated record-struct hashes. String through Object uses a UTF-8 content hash consistent with exact text equality. String ReferenceEquals and explicit Object base equality/hashing use shared text-owner identity. Content hashes and identity hashes serve different contracts. Other boxed primitives remain unsupported. Explicit Object base calls retain the identity hash. An equality override must provide a compatible hash.