[WEBINAR] Bulletproof: How Today's Business Leaders Stay on Top

Hash Code

Definition - What does Hash Code mean?

Hash code in .NET framework is a numeric value which helps in identification of an object during equality testing and also can serve as an index for the object. The value contained in the hash code is not permanent in nature. The purpose of hash code is to help in efficient lookup and insertion in data collections which are based on a hash table.

Techopedia explains Hash Code

Two objects are considered equal if they return equal hash codes. However, matching resultant hash codes do not necessarily mean object equality, or in other words, the reverse does not hold true. Because of this reason, hash code should never be used outside the boundaries of the application domain, as the same object could have different values outside the domain, processes or platforms.

As the value in hash code is temporary in nature, it should never be used as a key for data retrieval from a keyed data collection and should never be serialized or stored in databases. The GetHashCode method is used in .NET framework to get the hash code. It is suited for hashing algorithms or for data structures such as hash tables. The value returned by the function could differ between different .NET framework versions. As such, the framework does not approve the default implementation of the method, and so should not be used for finding the unique object identifier in the case of hashing purposes.

Hash code can aid in data comparison tasks. It can also help in one-way encryption, as the generated numeric value cannot be traced back to the original message data.

Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.