6.2 Hash function

A hash function takes a string of any length, and map it to an integer within a range, $ 0,\ldots n-1$ . It is not an injection because more than one strings can map to the same integer value. This is because there is an infinite number of strings (more than $ n$ ), but each one has an integer hash value between 0 and $ n-1$ inclusively.

Many hash functions, including MD5, are surjective.



Copyright © 2006-10-28 by Tak Auyeung