Example Hash Function
Throughout these lessons, we have been using relatively simple hash functions that just correspond to the length of a string or the index of the string's first character. However, these aren't necessarily good hash functions for use in actual applications. Remember that hash functions should (more or less) map keys to hash values uniformly at random -- we wouldn't want every word that starts with 'a'
to be mapping to the same hash value!
The following video shows how to define a hash function that can be used on strings: