REALScience: Making Hash
An introduction to hash functions
Issue: 8.4 (May/June 2010)
Author: JC Cruz
Article Description: No description available.
Article Length (in bytes): 23,418
Starting Page Number: 31
RBD Number: 8411
8411.zip Updated: Monday, May 3, 2010 at 7:59 PM
Related Web Link(s):
place download URL here
Known Limitations: None
Excerpt of article text...
Welcome back to another round of REALScience. Today, we journey into that poorly understood field of hash functions. We begin by understanding what a hash function is and what benefits it brings to our code toolbox. Then we study the parts that make up a basic function. Next, we survey a handful of general-purpose functions and learn how they work. We then subject these functions to a series of standard tests and compare the results against REALbasic's built-in hash. So get yourselves a cup of hot brew and let us commence.
The Theory of Hash
Hash functions are part of a group of algorithms known as one-way functions. Like many functions, they convert data from one form to another. The reverse, however, is either too difficult, if not nigh impossible to do. Examples of other one-way functions include checksum routines, ciphers, and random number generators.
A hash function works by reducing a large data item into another item. This second item, called a hash, is usually an integer or a byte string of limited length. It is "unique" to the input data--a slight change in input often results in a completely different hash. It is this one-to-one mapping that makes the hash function a useful tool.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.