GetHashCode()
-
Every type of object has the method GetHashCode(). I want to learn what the number return by GetHashCode method use by programmers. And is it releated with hash tables
karanba
A hash code is used to get a compact value that can be used to efficiently compare large values. A good hash code is created from all data in the value, has an even distribution over the possible hash codes, and shows a large difference in the hash code for a small change in the value. Hash codes can be used to see if two values are different, which for example is used to compare large files. Even if they only differ by a single bit, their hash codes will be completely different. Hash codes are used in hashtables to arrange the data so that a key can easily be found using the hash code of the key. To keep the search tree balanced, it's important that the distribution of the hash codes is even.
--- b { font-weight: normal; }
-
A hash code is used to get a compact value that can be used to efficiently compare large values. A good hash code is created from all data in the value, has an even distribution over the possible hash codes, and shows a large difference in the hash code for a small change in the value. Hash codes can be used to see if two values are different, which for example is used to compare large files. Even if they only differ by a single bit, their hash codes will be completely different. Hash codes are used in hashtables to arrange the data so that a key can easily be found using the hash code of the key. To keep the search tree balanced, it's important that the distribution of the hash codes is even.
--- b { font-weight: normal; }