Category: 

What Is a Hash Calculator?

Article Details
  • Written By: Eugene P.
  • Edited By: Angela B.
  • Last Modified Date: 19 July 2017
  • Copyright Protected:
    2003-2017
    Conjecture Corporation
  • Print this Article

A hash calculator can be several things but, in a very broad sense, refers to a program or function that accepts some type of input and then runs that input through an algorithm to create an output value, such as a large number or a block of symbols. The term often is used in data transmission to refer to a program that creates a type of key with an algorithm so anyone receiving the data transmitted can use the same algorithm to get the same key to see if the data arrived intact and unmodified. In computer programming, the term "hash calculator" can be used to indicate a hash function that turns some type of data into a hash key that then is processed by another algorithm to create an index into an array in which the information can be stored. Although both concepts of the calculator are similar, the results are very different and usually are not interchangeable. One common property of a hash calculator, regardless of its use, is that the hash value generated will always be the identical for a given piece of data, regardless of where or when the program is run.

Ad

At its core, a hash calculator is just a program or function that creates a hash from some data. A hash is just a word for a value and can be anything from a number to a string of hundreds of alphanumeric characters, depending on how it is being used. The data that are added to a hash calculator to create a hash also can be almost anything. When used for error checking in data transmission, the source for a hash value usually is a complete document or data file, such as an email or an image file. In programming, because the hash value is used to determine where data records are stored in a hash table, the input value usually is some part of a data record that is unique, such as the last name of a person, a phone number or an account number.

In the case of data transmission, a hash calculator uses any one of hundreds of different mathematical algorithms to create the unique hash value for the information being transmitted. This can be something as simple as adding all the values of all the bytes in a file, in which case the hash value is the sum. It also can be much more complex, involving counting blocks of bits or redundantly processing different sequences of numbers. One of the most important aspects of any hash algorithm, however, is that the resulting hash value must always be the same if the same data is used as input. This concept means that, if a file is transmitted with its own calculated hash value, then the receiver of the data can use a hash calculator with the same algorithm to determine if the hash values for the data match, verifying that the data were received intact and without errors or changes.

In programming, the term "hash calculator" frequently is used to describe a function that converts a piece of datum into a hash value. Unlike data transmission, the number generated by the calculator in this instance is not necessarily used for verification but to calculate an index into a hash table where the information will be stored. An intermediary hash value is calculated to allow for a larger number of data records to be predictably placed into a smaller hash table, with some records generating the same values under certain circumstances. Both the algorithm used to calculate a hash value and the data used as input are fairly arbitrary for a hash table and usually application-specific.

Ad

Recommended

Discuss this Article

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email