Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. GetHashCode()

GetHashCode()

Scheduled Pinned Locked Moved C#
cryptography
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    karanba
    wrote on last edited by
    #1

    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

    G 1 Reply Last reply
    0
    • K karanba

      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

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      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; }

      K 1 Reply Last reply
      0
      • G Guffa

        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; }

        K Offline
        K Offline
        karanba
        wrote on last edited by
        #3

        Thanks very much. I got the subject.

        karanba

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups