Hashing
is the transformation of a string of characters into a usually shorter
fixed-length value or key that represents the original string. Hashing is used
to index and retrieve items in a database because it is faster to find the item
using the shorter hashed key than to find it using the original value. It is
also used in many encryption algorithms.
Hash Function:
A
Hash Function is a Unary Function that is used by Hashed Associative
Containers: it maps its argument to a result of type size_t. A Hash Function must be deterministic and
stateless. That is, the return value must depend only on the argument, and
equal arguments must yield equal results.
Hash functions
are mostly used in hash tables, to quickly locate a data record (for
example, a dictionarydefinition) given its search
key (the headword). Specifically, the hash function is used to map
the search key to the index of a slot in the table where the corresponding
record is supposedly stored.
Division Method:
Division Method: