(internal) Return the hash for the key. The default implementation just returns the key, which is not appropriate for general purpose use.