Hash function
From Wikipedia, the free encyclopedia
A
hash function
is any welldefined procedure or
mathematical function which converts a large, possibly
variablesized amount of data into a small datum, usually
a single integer that may serve as an index to an array. The
values returned by a hash function are called
hash values
,
hash codes
,
hash sums
, or simply
hashes
.
Hash functions are mostly used to speed up table lookup
or data comparison tasks — such as finding items in a
database, detecting duplicated or similar records in a large
file, finding similar stretches in DNA sequences, and so
on.
A hash function may map two or more keys to the same
hash value. In many applications, it is desirable to
minimize the occurrence of such collisions, which means
that the hash function must map the keys to the hash values as evenly as possible. Depending on the
application, other properties may be required as well. Although the idea was conceived in the 1950s
[1]
, the design of good hash functions is still a topic of active research.
Hash functions are related to (and often confused with) checksums, check digits, fingerprints,
randomization functions, error correcting codes, and cryptographic hash functions. Although these
concepts overlap to some extent, each has its own uses and requirements and is designed and
optimised differently. The HashKeeper database maintained by the National Drug Intelligence
Center, for instance, is more aptly described as a catalog of file fingerprints than of hash values.
Contents
±
1 Applications
±
1.1 Hash tables
±
1.2 Caches
±
1.3 Bloom filters
±
1.4 Finding duplicate records
±
1.5 Finding similar records
±
1.6 Finding similar substrings
±
1.7 Geometric hashing
±
2 Properties
±
2.1 Low cost
±
2.2 Determinism
±
2.3 Uniformity
±
2.4 Variable range
±
2.5 Data normalization
±
2.6 Continuity
±
3 Hash function algorithms
±
3.1 Trivial hash function
±
3.2 Perfect hashing
±
3.3 Minimal perfect hashing
±
3.4 Hashing uniformly distributed data
A hash function that maps names to
integers from 0 to 15. Note the collision
between keys "John Smith" and "Sandra
Dee".
페이지
1/±9
Hash function  Wikipedia, the free encyclopedia
20091206
http://en.wikipedia.org/wiki/Hash_function
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentApplications
Hash tables
Hash functions are primarily used in hash tables, to quickly locate a data record (for example, a
dictionary definition) given its search key (the headword). Specifically, the hash function is used to
map the search key to the hash. The index gives the place where the corresponding record should be
stored. Hash tables, in turn, are used to implement associative arrays and dynamic sets.
In general, a hashing function may map several different keys to the same index. Therefore, each slot
of a hash table is associated with (implicitly or explicitly) a set of records, rather than a single record.
For this reason, each slot of a hash table is often called a
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '09
 Lee
 hash function, Wikipedia

Click to edit the document details