Static hashing is a form of hashing where lookups are performed on a finalized dictionary set (all objects in the dictionary are final and not changing).

Usage

edit

Application

edit

Since static hashing requires that the database, its objects, and reference remain the same, its applications are limited. Databases which contain information which changes rarely are also eligible as it would only require a full rehash of the entire database on rare occasion. Examples of this include sets of words and definitions of specific languages, sets of significant data for an organization's personnel, etc.[1]

Perfect hashing

edit

Perfect hashing is a model of hashing in which any set of elements can be stored in a hash table of equal size and can have lookups done in constant time. It was specifically discovered and discussed by Fredman, Komlos and Szemeredi (1984) and has therefore been nicknamed "FKS hashing".[2]

FKS hashing

edit

FKS hashing makes use of a hash table with two levels in which the top level contains buckets which each contain their own hash table. FKS hashing requires that if collisions occur they must do so only on the top level.

Implementation

edit

The top level contains a randomly created hash function, , which fits within the constraints of a Carter and Wegman hash function from universal hashing. Having done so the top level shall contain buckets labeled . Following this pattern, all of the buckets hold a hash table of size and a respective hash function . The hash function will be decided by setting to and randomly going through functions until there are no collisions. This can be done in constant time.

Performance

edit

Because there are pairs of elements, of which have a probability of collision equal to , FKS hashing can expect to have strictly less than collisions. Based on this fact and that each was selected so that the number of collisions would be at most , the size of each table on the lower level will be no greater than .

See also

edit

References

edit
  1. ^ Daniel Roche (2013). SI486D: Randomness in Computing, Hashing Unit. United States Naval Academy, Computer Science Department.
  2. ^ Michael Fredman; János Komlós; Endre Szemerédi (1984). Storing a Sparse Table with O(1) Worst Case Access Time. Journal of the ACM (Volume 31, Issue 3).

📚 Artikel Terkait di Wikipedia

Hash table

hashing by division, hashing by multiplication, universal hashing, dynamic perfect hashing, and static perfect hashing. However, hashing by division is the

Hash function

hashing is known as geometric hashing or the grid method. In these applications, the set of all inputs is some sort of metric space, and the hashing function

Dynamic perfect hashing

of optimal static hashing was first solved in general by Fredman, Komlós and Szemerédi. In their 1984 paper, they detail a two-tiered hash table scheme

Cryptographic hash function

Hashing is a one-directional mathematical operation which is quick to calculate, yet hard to reverse. So password storage and digital signatures benefit

ObjectDatabase++

recovery, hierarchical object data design, native code and script access, static hash index on object IDs, numerous supported index methods including full-text

Rendezvous hashing

hashing (see below). Rendezvous hashing was invented by David Thaler and Chinya Ravishankar at the University of Michigan in 1996. Consistent hashing

Cuckoo hashing

inserting a new key into a cuckoo hashing table may push an older key to a different location in the table. Cuckoo hashing was first described by Rasmus Pagh

MurmurHash

c2 hash ← hash XOR remainingBytes hash ← hash XOR len hash ← hash XOR (hash >> 16) hash ← hash × 0x85ebca6b hash ← hash XOR (hash >> 13) hash ← hash ×