Category: 

What are Hash Values?

Article Details
  • Written By: Jessica Reed
  • Edited By: Heather Bailey
  • Last Modified Date: 29 November 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
President Richard Nixon had an entire speech prepared in case the Apollo 11 astronauts became stranded on the Moon.  more...

December 8 ,  1965 :  Pope Paul VI promulgated Vatican II into ecumenical law.  more...

The term hash value refers to a piece of data, known as a value, given as the answer to a hash function. Hash functions are one and the same as hash algorithms, and perform the operation of turning a large set of data into a smaller set which represents the full set. This process is referred to as hashing and is often used in computer databases. It allows the computer to create a short code or symbol which represents a large piece of data. When the computer needs to retrieve the large piece of data from a vast database, it simply inserts the code or symbol and through the use of a hash function it finds the larger piece of data.

Codes and symbols that represent shorter forms of data are known as keys. Using short keys saves time when searching through a large database. They are also used in some encryption and decryption functions. The user inputs the key code and the hash function searches for the matching hash value within the database. Each key connects with a certain hash value and should link the user to the relevant data information he is looking for.

Ad

An example of keys and hash values in everyday use would be a library computer which could use a hash function to link a person's name to the books he's checked out. Each person in the database is assigned a key. For example, customer John Smith's name would function as the key code while he might receive a hash value of 01. This hash value links the key to a spot for storing data, often referred to as a bucket. When John Smith checks out a book, the computer puts the title of that book into the corresponding virtual bucket.

To see which books John Smith has checked out, the librarian could enter his name, which is the key, and the hash function would link John Smith with his corresponding hash value of 01. It would then pull up all the data under 01 and display it. In this case, the data would be a list of books John Smith has checked out. Whether a library would actually use hash functions in this way depends on if a different type of function could perform the task more easily, but this example demonstrates the basic concept of hash values.

Hash values are most often used in hash tables or hash maps which work like the library example explained above. They link keys to certain hash values and allow the user to search for information. This process can help scientists in research such as trying to find two similar strands of DNA. It can also search a large database to ensure the user isn't about to enter duplicate content.

Problems arise when a hash collision occurs. This happens when more than one key links to the same hash value. While computer scientists try to avoid this, it can happen in a large database of information. As research into the field continues, people can create new ways to help lower the possibility of hash collisions and raise the accuracy and usefulness of using hash functions.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email