Hashing is used to distribute values across an "array of buckets", with each "bucket" containing a single entry. Hashing algorithms are (or should be) selected to give a good chance of distributing entries across the whole range of "buckets" and will vary according to teh number of such buckets available.
In your example with just two characters, it seems silly to hash the value at all - but if you don't then the number of buckets you need is enough to hold nearly all the possible entries: 64K. Which is silly, because it is very unlikely that you will generate that number of strings. If instead you use a primitive hash such as adding the two bytes together and taking the low eight bits of the result, then you can allocate just 256 buckets, saving a huge amount of memory.
There is a lot, lot more to hashing than this, and much too much to cover here, so I would suggest you start with Wiki:
http://en.wikipedia.org/wiki/Hash_table[
^] which provides a good overview.